From 31391241328ecbab4539fa157c98a6d09304d963 Mon Sep 17 00:00:00 2001 From: James <33908344+allen-munsch@users.noreply.github.com> Date: Tue, 24 Sep 2019 09:22:35 -0500 Subject: [PATCH] add check for cookie --- graphene_django/static/graphene_django/graphiql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/static/graphene_django/graphiql.js b/graphene_django/static/graphene_django/graphiql.js index a37bb83..d97c797 100644 --- a/graphene_django/static/graphene_django/graphiql.js +++ b/graphene_django/static/graphene_django/graphiql.js @@ -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); }