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

[or-cvs] r23143: {arm} fix: crashing error when ExitPolicy was undefined (caught by (arm/trunk/src/interface)



Author: atagar
Date: 2010-09-07 14:57:01 +0000 (Tue, 07 Sep 2010)
New Revision: 23143

Modified:
   arm/trunk/src/interface/connPanel.py
   arm/trunk/src/interface/headerPanel.py
Log:
fix: crashing error when ExitPolicy was undefined (caught by asn)
fix: extra comma in header panel display when ExitPolicy was undefined



Modified: arm/trunk/src/interface/connPanel.py
===================================================================
--- arm/trunk/src/interface/connPanel.py	2010-09-07 14:45:40 UTC (rev 23142)
+++ arm/trunk/src/interface/connPanel.py	2010-09-07 14:57:01 UTC (rev 23143)
@@ -198,6 +198,7 @@
       self.isBridge = self.conn.get_option("BridgeRelay")[0][1] == "1"
       
       policyEntries = torTools.getConn().getOption("ExitPolicy", multiple=True)
+      if not policyEntries: policyEntries = [] # if ExitPolicy is undefined, policyEntries is None
       self.exitPolicy = ",".join(policyEntries)
       self.exitPolicy = self.exitPolicy.replace("\\t", " ").replace("\"", "")
       

Modified: arm/trunk/src/interface/headerPanel.py
===================================================================
--- arm/trunk/src/interface/headerPanel.py	2010-09-07 14:45:40 UTC (rev 23142)
+++ arm/trunk/src/interface/headerPanel.py	2010-09-07 14:57:01 UTC (rev 23143)
@@ -177,7 +177,7 @@
         exitPolicy = self.vals["tor/exitPolicy"]
         
         # adds note when default exit policy is appended
-        if exitPolicy == None: exitPolicy = "<default>"
+        if exitPolicy == "": exitPolicy = "<default>"
         elif not exitPolicy.endswith((" *:*", " *")): exitPolicy += ", <default>"
         
         # color codes accepts to be green, rejects to be red, and default marker to be cyan