Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 556ef45

Browse files
committed
make sure history is not an empty list
1 parent a9f0c95 commit 556ef45

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plotly/api/v2/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ def validate_response(response):
107107
if not message:
108108
message = content if content else 'No Content'
109109

110-
if not response.history[0].url.startswith('https:'):
111-
raise exceptions.PlotlyRequestError(HTTP_ERROR_MESSAGE,
112-
status_code, content)
110+
if len(response.history) > 0:
111+
if not response.history[0].url.startswith('https:'):
112+
raise exceptions.PlotlyRequestError(HTTP_ERROR_MESSAGE,
113+
status_code, content)
113114

114115
raise exceptions.PlotlyRequestError(message, status_code, content)
115116

0 commit comments

Comments
 (0)