diff options
author | Simon Schampijer <simon@schampijer.de> | 2012-06-06 12:38:25 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2012-06-06 12:57:52 (GMT) |
commit | d57212a040434140482f5371494bc116cbc9360b (patch) | |
tree | ceb7d4bb9672593079b56991d4be786446488723 | |
parent | af320f91f800ed9a46e84f12e9aa1ae3b95493b4 (diff) |
Make sure we have a widget before attaching an invoker, SL #3460
The _ToolbarPalette does get passed the invoker on
initialisation. But we do create the PaletteWindowWidget
later. We do attach the invoker to the widget when calling
_setup_widget that is why it was still working without that
patch.
This patch prevents the traceback that we had because of not
having a widget at this point.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Tested-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | src/sugar3/graphics/palettewindow.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py index c3431b7..2c8816c 100644 --- a/src/sugar3/graphics/palettewindow.py +++ b/src/sugar3/graphics/palettewindow.py @@ -498,7 +498,8 @@ class PaletteWindow(GObject.GObject): self._invoker_hids.remove(hid) self._invoker = invoker - self._widget.set_invoker(self._invoker) + if self._widget is not None: + self._widget.set_invoker(invoker) if invoker is not None: self._invoker_hids.append(self._invoker.connect( 'mouse-enter', self._invoker_mouse_enter_cb)) |