command:base: only cleanup UseInterface.storage_callback if it's there.
authorW. Trevor King <wking@tremily.us>
Fri, 24 Aug 2012 13:38:13 +0000 (09:38 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 24 Aug 2012 13:38:13 +0000 (09:38 -0400)
It's hard to see why it wouldn't be, but .setup_command handles the
case where it's missing, so we should be consistent here.

libbe/command/base.py

index 40e4bf999e8473cdfab60554f836a1d299a3ef63..a5af1f0677bff88b3199e82389eeca87ecede065 100644 (file)
@@ -583,5 +583,6 @@ class UserInterface (object):
         return self._user_id
 
     def cleanup(self):
-        self.storage_callbacks.cleanup()
+        if self.storage_callbacks is not None:
+            self.storage_callbacks.cleanup()
         self.io.cleanup()