]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Prevent failure of /solved command if /state had never been run
[turbot] / turbot / interaction.py
index e6aadb62269d7b7b8912eeab5d8d8d4bc236a3d3..359823464f40e5e31de28aa07abc2738bed1ca68 100644 (file)
@@ -576,7 +576,8 @@ def solved(turb, body, args):
     # Set the status and solution fields in the database
     puzzle['status'] = 'solved'
     puzzle['solution'].append(args)
-    del puzzle['state']
+    if 'state' in puzzle:
+        del puzzle['state']
     turb.table.put_item(Item=puzzle)
 
     # Report the solution to the puzzle's channel