From 487ab109334601367c1679b08a6a5bba42c8189c Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Thu, 25 Feb 2021 11:21:59 -0700 Subject: [PATCH] fix for symbols without a dividend --- IEX_Symbol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IEX_Symbol.py b/IEX_Symbol.py index 69cc42b..afc69c2 100644 --- a/IEX_Symbol.py +++ b/IEX_Symbol.py @@ -234,7 +234,7 @@ class IEX_Symbol: 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",