Skip to content

Commit

Permalink
Validation for empty recipe directions
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-DeForrest-Reynolds committed Dec 4, 2023
1 parent 1aaec9a commit b1445a9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Forms/RecipeDirectionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ private void Form_KeyDown(object Sender, KeyEventArgs KE)

private void Submit_Recipe_Direction_Click(object Sender, EventArgs E)
{
MF.RecipeDirections.Items.Add(RecipeDirection.Text);
Close();
if (RecipeDirection.Text != "")
{
MF.RecipeDirections.Items.Add(RecipeDirection.Text);
Close();
}
else
{
TB.Send_Message_Box("You cannot submit an empty description", "Empty Direction");
}
}
}
}

0 comments on commit b1445a9

Please sign in to comment.