try except to prevent crash when no portfolio_settings,json file

This commit is contained in:
Justin 2023-03-17 15:15:50 +08:00 committed by GitHub
parent bf6a515b17
commit e68401eb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1720,7 +1720,7 @@ class StockTicker():
else:
stitchedStock = midFrame
try:
if all_stocks_settings['chart'] and (symbol in portfolio_settings): #IF USER INPUTTED PORTFOLIO SETTINGS, DISPLAY PORTFOLIO INFO
try:
cost = portfolio_settings[symbol]['cost']
@ -1801,13 +1801,18 @@ class StockTicker():
img.paste(daychange2_img, (x_offset, 24))
except:
pass
except:
pass
image_list.append(stitchedStock)
try:
if all_stocks_settings['chart'] and (symbol in portfolio_settings):
try:
image_list.append(img)
except:
pass
except:
pass
image_list.append(self.blank)
except Exception as e:
pass