From 2fb84acfa4cd7544be829a35b9d4539c870d6c82 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 14 Aug 2011 14:00:01 +0200 Subject: Catch exception if getting the provider information fails This can happen if the provider disappears from the mobile-broadband-provider-info db. --- src/prepaid-manager-applet.py | 13 +++++++++---- 1 file 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: -- cgit v1.2.3