From 4560215d7a4e9fa3f8f36434986aa7eedee0a7df Mon Sep 17 00:00:00 2001 From: knotteye Date: Sun, 25 Apr 2021 15:06:00 -0500 Subject: [PATCH] Handle bad acctList settings --- plchat.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plchat.py b/plchat.py index 87c6603..e002c9a 100644 --- a/plchat.py +++ b/plchat.py @@ -200,9 +200,15 @@ class App(QMainWindow): if not acctList: self.newAcctDialog() return - for acct in acctList: - CallThread(getAvi, None, acct['instance']) - self.initAcct(acct['instance'], acct['username']) + for ind in range(0,len(acctList)): + CallThread(getAvi, None, acctList[ind]['instance']) + try: + self.initAcct(acctList[ind]['instance'], acctList[ind]['username']) + except: + print("account info corrupted, deleting") + del acctList[ind] + if acctList: + self.settings.setValue('acctList', acctList) def systrayClicked(self, reason): if reason == QSystemTrayIcon.Trigger: