[meld] Guard against an unset action group in initial switch



commit ab881e8993fc31b4fc35d6509c0eaa5cb3679d99
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Sep 6 07:48:03 2013 +1000

    Guard against an unset action group in initial switch

 meld/filediff.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 625ad29..aaf1d22 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -937,8 +937,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             # widget.get_clipboard(
             #    gtk.gdk.SELECTION_CLIPBOARD).wait_is_text_available()
             paste = widget.get_editable()
-        for action, sens in zip(("Cut", "Copy", "Paste"), (cut, copy, paste)):
-            self.main_actiongroup.get_action(action).set_sensitive(sens)
+        if self.main_actiongroup:
+            for action, sens in zip(
+                    ("Cut", "Copy", "Paste"), (cut, copy, paste)):
+                self.main_actiongroup.get_action(action).set_sensitive(sens)
 
     def get_selected_text(self):
         """Returns selected text of active pane"""


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