mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-30 20:07:48 +08:00
Fix metadataForPluginId crash when value is null
This commit is contained in:
parent
6b5a74f718
commit
b08f1ceb49
1 changed files with 5 additions and 2 deletions
|
@ -79,12 +79,15 @@ export class ModelWithMetadata extends Model {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const value = JSON.parse(JSON.stringify(metadata.value));
|
const value = JSON.parse(JSON.stringify(metadata.value));
|
||||||
if (value.expiration) {
|
if (value === null || value === undefined) {
|
||||||
value.expiration = new Date(value.expiration * 1000);
|
return null;
|
||||||
}
|
}
|
||||||
if (Object.keys(value).length === 0) {
|
if (Object.keys(value).length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (value.expiration) {
|
||||||
|
value.expiration = new Date(value.expiration * 1000);
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue