From d3418db3d1e78df7fc6d6d97bb3ba330987cb518 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 8 Dec 2017 11:30:29 -0500 Subject: [PATCH] 3300 fix npe by adding tags to casedb in tagsmanager constructor --- .../autopsy/casemodule/services/TagNameDefinition.java | 2 +- .../org/sleuthkit/autopsy/casemodule/services/TagsManager.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java index e1d81d2b65..e1d90d2f15 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java @@ -179,7 +179,7 @@ final class TagNameDefinition implements Comparable { return displayName + "," + description + "," + color.name() + "," + knownStatus.toString(); } - private TagName saveToCase(SleuthkitCase caseDb) { + TagName saveToCase(SleuthkitCase caseDb) { TagName tagName = null; try { tagName = caseDb.addOrUpdateTagName(displayName, description, color, knownStatus); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index f96fe08f23..8d7eda2ec4 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -128,6 +128,9 @@ public class TagsManager implements Closeable { */ TagsManager(SleuthkitCase caseDb) { this.caseDb = caseDb; + for (TagNameDefinition tagName : TagNameDefinition.getTagNameDefinitions()) { + tagName.saveToCase(caseDb); + } } /**