diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index eeb63375..b0c623f0 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -1217,7 +1217,13 @@ module.TagsEditActions = actions.Actions({ tags = tags instanceof Array ? tags : [tags] var that = this - gids = gids.map(function(gid){ return that.data.getImage(gid) }) + gids = gids + .map(function(gid){ return that.data.getImage(gid) }) + .filter(function(gid){ return gid != null }) + + if(gids.length == 0){ + return + } // data... this.data.tag(tags, gids) diff --git a/ui (gen4)/features/marks.js b/ui (gen4)/features/marks.js index 84d894f6..501ac239 100755 --- a/ui (gen4)/features/marks.js +++ b/ui (gen4)/features/marks.js @@ -37,14 +37,20 @@ var ui = require('features/ui') function makeTagTogglerAction(tag){ // get actual target gids... var _getTarget = function(target){ - target = target || 'current' + target = target || this.current target = target == 'all' - || target == 'loaded' - || target in this.data.ribbons - ? this.data.getImages(target) - : target == 'ribbon' ? this.data.getImages('current') + || target == 'loaded' + || target in this.data.ribbons + ? + this.data.getImages(target) + : target == 'ribbon' ? + this.data.getImages('current') : target - return target instanceof Array ? target : [target] + return target == null ? + [] + : target instanceof Array ? + target + : [target] } // the toggler...