[or-cvs] r22259: {arm} fix: crashing error if TorCtl reports TorCtlClosed before th (arm/trunk/interface)

Damian Johnson atagar1 at gmail.com
Fri Apr 30 15:01:15 UTC 2010


Author: atagar
Date: 2010-04-30 15:01:15 +0000 (Fri, 30 Apr 2010)
New Revision: 22259

Modified:
   arm/trunk/interface/headerPanel.py
Log:
fix: crashing error if TorCtl reports TorCtlClosed before the first refresh (caught by Tas)



Modified: arm/trunk/interface/headerPanel.py
===================================================================
--- arm/trunk/interface/headerPanel.py	2010-04-30 14:57:31 UTC (rev 22258)
+++ arm/trunk/interface/headerPanel.py	2010-04-30 15:01:15 UTC (rev 22259)
@@ -223,7 +223,7 @@
       except TorCtl.ErrorReply: self.vals[param] = "Unknown"
       except (TorCtl.TorCtlClosed, socket.error):
         # Tor shut down or crashed - keep last known values
-        if not self.vals[param]: self.vals[param] = "Unknown"
+        if not param in self.vals.keys() or not self.vals[param]: self.vals[param] = "Unknown"
     
     # if ORListenAddress is set overwrites 'address' (and possibly ORPort)
     try:



More information about the tor-commits mailing list