add check for cookie

This commit is contained in:
James 2019-09-24 09:22:35 -05:00 committed by GitHub
parent 9710d008f4
commit 3139124132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@
try {
return JSON.parse(responseBody);
} catch (error) {
if (cookies.csrftoken.length) {
if (cookies.csrftoken && cookies.csrftoken.length) {
headers['X-CSRFToken'] = cookies.csrftoken.pop();
return getFetch(headers);
}