From 2422489bba3ef9fc6d0094788a4703bd8a6d315d Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Wed, 24 Feb 2021 23:18:07 -0700 Subject: [PATCH] bug where symbol had no dividend --- functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.py b/functions.py index 44e3d04..f27724d 100644 --- a/functions.py +++ b/functions.py @@ -282,7 +282,7 @@ _Donations can only be made in a chat directly with @simplestockbot_ IEXurl = f"https://cloud.iexapis.com/stable/stock/{symbol}/dividends/next?token={self.IEX_TOKEN}" response = r.get(IEXurl) - if response.status_code == 200: + if response.status_code == 200 and response.json(): IEXData = response.json()[0] keys = ( "amount",