mirror of
https://github.com/gosticks/web.git
synced 2026-12-03 17:51:39 +00:00
Check if the errors array exists before referencing it
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user