From 790fc2ffaa11c6615bb2b619975eede02a7d144f Mon Sep 17 00:00:00 2001 From: viniciusbds Date: Fri, 18 Oct 2019 00:23:26 -0300 Subject: [PATCH] Dealing with a possible null pointer dereference --- .../commands/project/SetProjectTagsCommand.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main/src/com/google/refine/commands/project/SetProjectTagsCommand.java b/main/src/com/google/refine/commands/project/SetProjectTagsCommand.java index 71fbba7f1..c3e67e311 100644 --- a/main/src/com/google/refine/commands/project/SetProjectTagsCommand.java +++ b/main/src/com/google/refine/commands/project/SetProjectTagsCommand.java @@ -81,13 +81,15 @@ public class SetProjectTagsCommand extends Command { tag = tag.trim(); if (!tag.isEmpty()) { - if (allProjectTags!= null && allProjectTags.containsKey(tag)) { - allProjectTags.put(tag, allProjectTags.get(tag) + 1); - } else { - allProjectTags.put(tag, 1); + if (allProjectTags!= null) { + if (allProjectTags.containsKey(tag)) { + allProjectTags.put(tag, allProjectTags.get(tag) + 1); + } else { + allProjectTags.put(tag, 1); + } } polishedTags.add(tag); - } + } } // Lets update the project tags