Blob Blame History Raw
commit 48b6c1b7d3bce22f820c646497ccd617f06d336c
Author: Jiri Popelka <jpopelka@redhat.com>
Date:   Thu Jan 16 13:57:57 2014 +0100

    firewall-config: richRuleDialogActionRejectTypeCombobox handling (RHBZ#1054120)
    
    ammends d737d69067

diff --git a/src/firewall-config b/src/firewall-config
index 07b3030..91baab6 100755
--- a/src/firewall-config
+++ b/src/firewall-config
@@ -2200,15 +2200,16 @@ class FirewallConfig(object):
                 elif type(old_obj.action) == Rich_Reject:
                     action = "reject"
                     self.richRuleDialogActionRejectTypeCombobox.remove_all()
-                    for icmp in REJECT_TYPES[old_obj.family]:
-                        self.richRuleDialogActionRejectTypeCombobox. \
-                                                    append(icmp, icmp)
-                    if old_obj.action.type:
-                        self.richRuleDialogActionRejectTypeCombobox. \
-                                         set_active_id(old_obj.action.type)
-                    else:
-                        self.richRuleDialogActionRejectTypeCombobox. \
-                             set_active_id(REJECT_TYPES[old_obj.family][0])
+                    if old_obj.family != None:
+                        for icmp in REJECT_TYPES[old_obj.family]:
+                            self.richRuleDialogActionRejectTypeCombobox. \
+                                                        append(icmp, icmp)
+                        if old_obj.action.type:
+                            self.richRuleDialogActionRejectTypeCombobox. \
+                                            set_active_id(old_obj.action.type)
+                        else:
+                            self.richRuleDialogActionRejectTypeCombobox. \
+                                set_active_id(REJECT_TYPES[old_obj.family][0])
                 elif type(old_obj.action) == Rich_Drop:
                     action = "drop"
                 combobox_select_text(self.richRuleDialogActionCombobox, action)
@@ -2684,7 +2685,8 @@ class FirewallConfig(object):
             for icmp in REJECT_TYPES[family]:
                 self.richRuleDialogActionRejectTypeCombobox.append(icmp, icmp)
             old_obj = self.richRuleDialog.old_obj
-            if old_obj and old_obj.family == family and old_obj.action.type:
+            if old_obj and old_obj.family == family and \
+               hasattr(old_obj.action, 'type') and old_obj.action.type:
                 self.richRuleDialogActionRejectTypeCombobox. \
                                      set_active_id(old_obj.action.type)
             else: