diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-08-14 14:00:01 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-08-14 14:01:14 +0200 |
commit | 2fb84acfa4cd7544be829a35b9d4539c870d6c82 (patch) | |
tree | 303946afa94acab34152ac107ea8741d7008bf27 | |
parent | 79efa1221be5b77e6e85b19645b602a63ee12860 (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-x | src/prepaid-manager-applet.py | 13 |
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: |