I have the following code to store image in database
private void btnSave_Click(object sender, EventArgs e)
        {   
            MemoryStream ms = new MemoryStream();
            pboxImage.Image.Save(ms, pboxImage.Image.RawFormat);
            byte[] byteimage = ms.ToArray();  
            AddClient.ADD_CLIENT(txtName.Text, byteimage);   
            MessageBox.Show("add successfuly);
        }
AddClient
public void ADD_CLIENT(string de_fullName, byte[] de_photo)
        {
            DAL.open();
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@de_fullName", SqlDbType.NVarChar, 50);
            param[0].Value = de_fullName;
            if ( de_photo == null)
            {
                param[1] = new SqlParameter("@de_photo", SqlDbType.Binary);
                param[1].Value = DBNull.Value;
            }
            else
            {
                param[1] = new SqlParameter("@de_photo", SqlDbType.Binary);
                param[1].Value = de_photo;
            }
            DAL.ExecuteCommand("ADD_CLIENT", param);
            DAL.close();
        }
it works if pboxImage has image but when it has no photo it gives me an error
System.NullReferenceException: 'Object reference not set to an instance of an object.'
