From 20fc2da9b5cb64e684c2fbaccdf8da15ddd1a056 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 28 Feb 2015 05:54:27 +0100 Subject: [PATCH] do not attemps last_wallet if file does not exist --- gui/qt/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py index cdd08a75..b3f35b60 100644 --- a/gui/qt/__init__.py +++ b/gui/qt/__init__.py @@ -149,10 +149,17 @@ class ElectrumGui: def main(self, url): - if self.config.get('wallet_path') is None and self.config.get('gui_last_wallet'): - self.config.read_only_options['wallet_path'] = self.config.get('gui_last_wallet') + last_wallet = self.config.get('gui_last_wallet') + if last_wallet is not None and self.config.get('wallet_path') is None: + if os.path.exists(last_wallet): + self.config.read_only_options['wallet_path'] = last_wallet + try: + storage = WalletStorage(self.config) + except BaseException as e: + QMessageBox.warning(None, _('Warning'), str(e), _('OK')) + self.config.set_key('gui_last_wallet', None) + return - storage = WalletStorage(self.config) if storage.file_exists: try: wallet = Wallet(storage)