Permalink
Browse files

minor change to handle a failure scenario gracefully

  • Loading branch information...
1 parent 7e4171a commit 12b2e22b2a49b1017087ec5ad2ac18a957eaa599 @claws committed May 20, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 txcurrentcost/monitor.py
View
@@ -146,7 +146,7 @@ def stop(self):
Stop the CurrenCost monitor
"""
logging.info('CurrentCostMonitor stopping')
- if self.protocol.transport:
+ if self.protocol and self.protocol.transport:
self.protocol.transport.loseConnection()
self.serialPort.close()

0 comments on commit 12b2e22

Please sign in to comment.