diff --git a/main/src/com/google/refine/ProjectManager.java b/main/src/com/google/refine/ProjectManager.java index 42ab4d168..9a046ea34 100644 --- a/main/src/com/google/refine/ProjectManager.java +++ b/main/src/com/google/refine/ProjectManager.java @@ -132,13 +132,14 @@ public abstract class ProjectManager { _projectsMetadata.put(project.id, projectMetadata); if (_projectsTags == null) _projectsTags = new HashMap(); - - for (String tag : projectMetadata.getTags()) { - if (_projectsTags.containsKey(tag)) { - _projectsTags.put(tag, _projectsTags.get(tag) + 1); - } else { - _projectsTags.put(tag, 1); - } + if(projectMetadata.getTags()!=null) { + for (String tag : projectMetadata.getTags()) { + if (_projectsTags.containsKey(tag)) { + _projectsTags.put(tag, _projectsTags.get(tag) + 1); + } else { + _projectsTags.put(tag, 1); + } + } } } } diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js b/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js index 1b50fdd8c..3cc466e39 100644 --- a/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js +++ b/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js @@ -342,7 +342,7 @@ Refine.TagsManager.allProjectTags = []; Refine.TagsManager._getAllProjectTags = function() { var self = this; - if (self.allProjectTags.length == 0) { + if (self.allProjectTags.length === 0) { jQuery.ajax({ url : "command/core/get-all-project-tags", success : function(result) { diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js index ea929cb5f..5593dbf4e 100644 --- a/main/webapp/modules/core/scripts/index/open-project-ui.js +++ b/main/webapp/modules/core/scripts/index/open-project-ui.js @@ -282,8 +282,8 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { $(tr.insertCell(tr.cells.length)); var tags = project.tags; - for (var i = 0; i < tags.length; i++) { - var tag = tags[i]; + for (var index = 0; index < tags.length; index++) { + var tag = tags[index]; $("") .addClass("project-tag") .text(tag) @@ -304,7 +304,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { .click(function() { var oldTags = project.tags.join(","); var newTags = window.prompt($.i18n._('core-index-open')["edit-tags-desc"],oldTags); - if (newTags === null || newTags == oldTags) { + if (newTags === null || newTags === oldTags) { return false; } $.ajax({ diff --git a/main/webapp/modules/core/scripts/util/filter-lists.js b/main/webapp/modules/core/scripts/util/filter-lists.js index c7103bdd1..33fa3e606 100644 --- a/main/webapp/modules/core/scripts/util/filter-lists.js +++ b/main/webapp/modules/core/scripts/util/filter-lists.js @@ -29,7 +29,7 @@ /* FILTERPORTFOLIO: pass in a class to show, all others will be hidden */ listElement.bind("filterMyList", function( e, classToShow ){ - if(classToShow == settings.allTag){ + if(classToShow === settings.allTag){ $(this).trigger("show"); }else{ $(this).trigger("show", [ '.' + classToShow ] );