From 502c73d3f294db6f0df95cf84deae72f08541ee7 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 9 Jan 2018 17:37:09 -0500 Subject: [PATCH] Check if the `errors` array exists before referencing it Signed-off-by: Mcat12 --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index a6dc382..2453107 100644 --- a/src/utils.js +++ b/src/utils.js @@ -144,7 +144,7 @@ export const api = { return data.json(); }, checkForErrors(data) { - if(data.errors.length > 0) { + if(!data.errors || data.errors.length > 0) { return Promise.reject(data.errors); } return Promise.resolve(data.data);