From 080ff933f22fdc4d4efa0a3dd2501c4e1118be34 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 25 Feb 2016 16:28:56 -0800 Subject: [PATCH] fix(metadata): Saving on non-existent models should not throw --- src/flux/stores/metadata-store.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flux/stores/metadata-store.es6 b/src/flux/stores/metadata-store.es6 index caef3563a..5dc8bc031 100644 --- a/src/flux/stores/metadata-store.es6 +++ b/src/flux/stores/metadata-store.es6 @@ -24,7 +24,7 @@ class MetadataStore extends NylasStore { return ( t.modelify(modelClass, _.pluck(models, 'clientId')) .then((latestModels)=> { - const updatedModels = latestModels.map(m => m.applyPluginMetadata(pluginId, metadataValue)); + const updatedModels = _.compact(latestModels).map(m => m.applyPluginMetadata(pluginId, metadataValue)); return ( t.persistModels(updatedModels) .then(()=> Promise.resolve(updatedModels))