gnome-games r7443 - in trunk/gnome-sudoku: . src/lib



Author: andreasr
Date: Sat Mar  1 20:56:13 2008
New Revision: 7443
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7443&view=rev

Log:
Fix crash when starting new game. Patch by my in bug #513894.


Modified:
   trunk/gnome-sudoku/ChangeLog
   trunk/gnome-sudoku/src/lib/gsudoku.py

Modified: trunk/gnome-sudoku/src/lib/gsudoku.py
==============================================================================
--- trunk/gnome-sudoku/src/lib/gsudoku.py	(original)
+++ trunk/gnome-sudoku/src/lib/gsudoku.py	Sat Mar  1 20:56:13 2008
@@ -902,6 +902,10 @@
         self.unhighlight_cells()
         if not hasattr(self,'box_color'): self.get_highlight_colors()
         my_x,my_y = self.focused.x,self.focused.y        
+
+        # col_coords can sometimes be null.
+        if not hasattr(self.grid, 'col_coords'): return
+
         for x,y in self.grid.col_coords[my_x]:
             if (x,y) != (my_x,my_y):
                 self.__entries__[(x,y)].set_background_color(self.col_color)
@@ -1150,7 +1154,7 @@
                     # Its possible this highlighted error was never
                     # added to our internal grid, in which case we'd
                     # better make sure it is...
-                    if not self.grid._get_(linked_entry.x,linked_entry.y):
+                    if self.grid and not self.grid._get_(linked_entry.x,linked_entry.y):
                         # entry_validate will add the value to our
                         # internal grid if there are no other
                         # conflicts



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