[gnome-games/sudoku-tube] Don't crash when no box is focused



commit 62ccdc78ebff21da75dd512dc0e5fc5d254cd7d6
Author: Zhang Sen <zh jesse gmail com>
Date:   Sat Jul 18 12:00:25 2009 +0800

    Don't crash when no box is focused

 gnome-sudoku/src/lib/main.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index f02a619..db97053 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -473,7 +473,8 @@ class UI (gconf_wrapper.GConfWrapper):
 
     def show_hint_cb (self, *args):
         current = self._main_grid_vew.get_focus()
-        self._notes_model.show_hint(current.x, current.y)
+        if current:
+            self._notes_model.show_hint(current.x, current.y)
 
     def auto_hint_cb (self, action):
         self._notes_model.toggle_auto_hint(action.get_active())
@@ -489,7 +490,8 @@ class UI (gconf_wrapper.GConfWrapper):
 
     def auto_fill_current_square_cb (self, *args):
         current = self._main_grid_vew.get_focus()
-        self._main_model.auto_fill_current(current.x, current.y)
+        if current:
+            self._main_model.auto_fill_current(current.x, current.y)
 
     def tracker_toggle_cb (self, widg):
         if widg.get_active():



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