mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-12-12 20:36:29 +01:00
Fix metadataForPluginId crash when value is null
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user