diff options
author | cos <cos> | 2013-04-27 15:13:26 +0200 |
---|---|---|
committer | cos <cos> | 2013-04-27 15:13:26 +0200 |
commit | e67393e1f4262dd4f81b822042cfe2ae8252046c (patch) | |
tree | 21d845774688b9b81033428070fe9d22161ff0bb | |
parent | e6edcc8fbb18e9fcc70037af4c476ae1f76c604d (diff) | |
download | mat-e67393e1f4262dd4f81b822042cfe2ae8252046c.zip |
Print a warning when including an empty recipe in shoppinglist.
-rwxr-xr-x | mat | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -663,6 +663,9 @@ sub cmd_shoppinglist { for my $recipe (@shop_recipes) { # my $contents = $db->selectall_arrayref("SELECT * FROM contents WHERE recipe_id=".$recipe.";"); my $contents = $db->selectall_hashref("SELECT * FROM contents WHERE recipe_id=".$recipe.";", 'ingredient_id'); + unless (%$contents) { + print "WARNING recipe $recipe contains no ingredients!\n"; + } for my $content ( keys(%$contents)) { # print %$contents, "\n"; my $ingredientcol = $db->selectcol_arrayref("SELECT name FROM ingredients WHERE id=".$content.";"); |