mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-16 02:03:42 +08:00
fix(metadata): add pluginId string check when grabbing metadata
This caused an infinitely growing set of duplicate metadata entries whose keys were "[object object]"
This commit is contained in:
parent
ff61da26d7
commit
610aecb184
1 changed files with 3 additions and 0 deletions
|
@ -82,6 +82,9 @@ export default class ModelWithMetadata extends Model {
|
|||
// Private helpers
|
||||
|
||||
metadataObjectForPluginId(pluginId) {
|
||||
if (typeof pluginId !== "string") {
|
||||
throw new Error(`Invalid pluginId. Must be a valid string: '${pluginId}'`, pluginId)
|
||||
}
|
||||
return this.pluginMetadata.find(metadata => metadata.pluginId === pluginId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue