From 84954c24f11660d658e6bdd6ed20b15cd0fbaeb9 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 31 May 2024 23:30:37 -0300 Subject: data: CacheableObject: check default update value more gracefully Fixes a test failure introduced in cebd7f4a, and more generally, crashes to do with flags: {update: true} but no update: {...} configuration. --- src/data/cacheable-object.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/data') diff --git a/src/data/cacheable-object.js b/src/data/cacheable-object.js index 4a89b774..71dc5bde 100644 --- a/src/data/cacheable-object.js +++ b/src/data/cacheable-object.js @@ -132,7 +132,11 @@ export default class CacheableObject { return; } - if ('default' in update) { + if ( + typeof update === 'object' && + update !== null && + 'default' in update + ) { this[property] = update?.default; } else { this[property] = null; -- cgit 1.3.0-6-gf8a5