aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-08-14 14:00:01 +0200
committerGuido Günther <agx@sigxcpu.org>2011-08-14 14:01:14 +0200
commit2fb84acfa4cd7544be829a35b9d4539c870d6c82 (patch)
tree303946afa94acab34152ac107ea8741d7008bf27
parent79efa1221be5b77e6e85b19645b602a63ee12860 (diff)
Catch exception if getting the provider information fails
This can happen if the provider disappears from the mobile-broadband-provider-info db.
-rwxr-xr-xsrc/prepaid-manager-applet.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/prepaid-manager-applet.py b/src/prepaid-manager-applet.py
index a1084ff..622b16f 100755
--- a/src/prepaid-manager-applet.py
+++ b/src/prepaid-manager-applet.py
@@ -163,10 +163,15 @@ class PPMController(GObject.GObject):
self.mm.modem_enable(reply_func=self.init_account_and_provider)
return True
-
- if self._get_account_from_accountdb(self.imsi):
- # Since we have the account in the db we can safely
- # fetch the provider information from the providerdb
+ try:
+ account = self._get_account_from_accountdb(self.imsi)
+ except:
+ # Fetching account from the DB failed, so start over
+ account = None
+
+ if account:
+ # Since we have the account in the db we can safely fetch the
+ # provider information from the providerdb
self.providerdb.get_provider(self.account.name,
self.account.code)
else: