From 4358bb9f942d193087df42e12f186038c636796f Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 20 Jul 2015 07:55:10 -0400 Subject: [PATCH] 8719: AttributeError: 'NoneType' object has no attribute 'set_cursor' --- gramps/gui/displaystate.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 6c661c9c6..2f8e3c368 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -532,16 +532,17 @@ class DisplayState(Callback): return else: self.busy = value - if value: - self.cursor = self.window.get_window().get_cursor() - self.window.get_window().set_cursor(self.BUSY_CURSOR) - else: - self.window.get_window().set_cursor(self.cursor) - if self.window.get_window().is_visible(): - #avoid critical gdk error: - #Gdk-CRITICAL **: gdk_error_trap_pop_internal: assertion `trap != NULL' failed - #only process events if window is actually visible - process_pending_events() + if self.window.get_window(): + if value: + self.cursor = self.window.get_window().get_cursor() + self.window.get_window().set_cursor(self.BUSY_CURSOR) + else: + self.window.get_window().set_cursor(self.cursor) + if self.window.get_window().is_visible(): + #avoid critical gdk error: + #Gdk-CRITICAL **: gdk_error_trap_pop_internal: assertion `trap != NULL' failed + #only process events if window is actually visible + process_pending_events() def set_open_widget(self, widget): self.widget = widget