gnome-games r8220 - trunk/gnome-sudoku/src/lib



Author: thomashpa
Date: Fri Oct 31 00:38:05 2008
New Revision: 8220
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8220&view=rev

Log:
Don't crash on old savegames by initializing non-existing values to 0. Fixes bug #557308. Patch by Zhang Sen

Modified:
   trunk/gnome-sudoku/src/lib/saver.py

Modified: trunk/gnome-sudoku/src/lib/saver.py
==============================================================================
--- trunk/gnome-sudoku/src/lib/saver.py	(original)
+++ trunk/gnome-sudoku/src/lib/saver.py	Fri Oct 31 00:38:05 2008
@@ -61,6 +61,9 @@
             ui.tracker_ui.select_tracker(tracker)
     for attr in SAVE_ATTRIBUTES:
         super_setattr(ui,attr,jar.get(attr,None))
+    for attr in SAVE_ATTRIBUTES:
+        if jar.get(attr,None) == None:
+            super_setattr(ui,attr,0)
     if jar.has_key('notes') and jar['notes']:
         for x,y,top,bot in jar['notes']:
             ui.gsd.__entries__[(x,y)].set_note_text(top,bot)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]