From e449dd36322384a3185c744f0462d4fe47b879c6 Mon Sep 17 00:00:00 2001 From: Jonas Krispin Date: Wed, 9 Dec 2020 15:22:48 +0100 Subject: [PATCH] fix($get): return null if item is not stored Instead of throwing because of try to insertOrUpdate null / undefined --- src/actions/Get.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/actions/Get.js b/src/actions/Get.js index 3513447..716755e 100644 --- a/src/actions/Get.js +++ b/src/actions/Get.js @@ -14,9 +14,14 @@ export default class Get extends Action { if (id) { return model.$localStore.getItem(id) - .then(record => dispatch('insertOrUpdate', { - data: record, - })); + .then(record => { + if (!record){ + return null + } + return dispatch('insertOrUpdate', { + data: record, + }) + }); } return null;