From b08f1ceb4941f44fb6e2c5a313a725c81249cd52 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Sun, 26 Jan 2025 17:22:40 -0600 Subject: [PATCH] Fix metadataForPluginId crash when value is null --- app/src/flux/models/model-with-metadata.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/flux/models/model-with-metadata.ts b/app/src/flux/models/model-with-metadata.ts index 73cf540f7..189b90c7d 100644 --- a/app/src/flux/models/model-with-metadata.ts +++ b/app/src/flux/models/model-with-metadata.ts @@ -79,12 +79,15 @@ export class ModelWithMetadata extends Model { return null; } const value = JSON.parse(JSON.stringify(metadata.value)); - if (value.expiration) { - value.expiration = new Date(value.expiration * 1000); + if (value === null || value === undefined) { + return null; } if (Object.keys(value).length === 0) { return null; } + if (value.expiration) { + value.expiration = new Date(value.expiration * 1000); + } return value; }