From 814db59cca49b5b8da30a002a29a1e44c3cd606a Mon Sep 17 00:00:00 2001 From: Justin Walters Date: Mon, 21 Apr 2025 14:20:33 -0400 Subject: [PATCH] Filter out nulls in response interceptor Calls to storage where the field doesn't exist return an array with a single null element. That throws an error when trying to access .type --- src/base/EnvoyAPI.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/EnvoyAPI.ts b/src/base/EnvoyAPI.ts index 4fef6f5..91718ce 100644 --- a/src/base/EnvoyAPI.ts +++ b/src/base/EnvoyAPI.ts @@ -74,6 +74,7 @@ export default class EnvoyAPI { (included || []) .concat(modelOrModels) + .filter((model: JSONAPIData | null) => model !== null) .forEach((model: JSONAPIData) => { this.dataLoader.prime({ type: model.type, id: model.id }, model); const alias = TYPE_ALIASES.get(model.type);