code review: only built-in assets are candidates for removal when updating assets.json

This commit is contained in:
gorhill 2017-01-18 13:35:10 -05:00
parent 3b9fd49c50
commit ff64a8340c
1 changed files with 5 additions and 2 deletions

View File

@ -352,9 +352,12 @@ var updateAssetSourceRegistry = function(json) {
getAssetSourceRegistry(function(oldDict) {
var assetKey;
// Remove obsolete entries
// Remove obsolete entries (only those which were built-in).
for ( assetKey in oldDict ) {
if ( newDict[assetKey] === undefined ) {
if (
newDict[assetKey] === undefined &&
oldDict[assetKey].submitter === undefined
) {
unregisterAssetSource(assetKey);
}
}