mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
catch IllegalStateException from Case.getCurrentCase() in TagsManager methods
This commit is contained in:
parent
2e034c19fd
commit
bce619b50e
@ -14,4 +14,8 @@ FileManager.addLocalDirInt2.exception.closed.msg=Attempted to use FileManager af
|
||||
TagsManager.addContentTag.exception.beginByteOffsetOOR.msg=beginByteOffset \= {0} out of content size range (0 - {1})
|
||||
TagsManager.addContentTag.exception.endByteOffsetOOR.msg=endByteOffset \= {0} out of content size range (0 - {1})
|
||||
TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset
|
||||
TagsManager.predefTagNames.bookmark.text=Bookmark
|
||||
TagsManager.predefTagNames.bookmark.text=Bookmark
|
||||
TagsManager.addContentTag.noCaseWarning=Failed to add publish new content tag event. There is no case open.
|
||||
TagsManager.deleteContentTag.noCaseWarning=Failed to add publish content tag deleted event. There is no case open.
|
||||
TagsManager.addBlackboardArtifactTag.noCaseWarning=Failed to add publish new blackboard artifact tag event. There is no case open.
|
||||
TagsManager.deleteBlackboardArtifactTag.noCaseWarning=Failed to add publish blackboard artifact tag deleted event. There is no case open.
|
||||
|
@ -248,7 +248,11 @@ public class TagsManager implements Closeable {
|
||||
}
|
||||
}
|
||||
final ContentTag newContentTag = tskCase.addContentTag(content, tagName, comment, beginByteOffset, endByteOffset);
|
||||
Case.getCurrentCase().notifyContentTagAdded(newContentTag);
|
||||
try {
|
||||
Case.getCurrentCase().notifyContentTagAdded(newContentTag);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
Logger.getLogger(TagsManager.class.getName()).log(Level.WARNING, NbBundle.getMessage(TagsManager.class, "TagsManager.addContentTag.noCaseWarning"));
|
||||
}
|
||||
return newContentTag;
|
||||
}
|
||||
|
||||
@ -266,7 +270,11 @@ public class TagsManager implements Closeable {
|
||||
}
|
||||
|
||||
tskCase.deleteContentTag(tag);
|
||||
Case.getCurrentCase().notifyContentTagDeleted(tag);
|
||||
try {
|
||||
Case.getCurrentCase().notifyContentTagDeleted(tag);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.getLogger(TagsManager.class.getName()).log(Level.WARNING, NbBundle.getMessage(TagsManager.class, "TagsManager.deleteContentTag.noCaseWarning"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -375,7 +383,11 @@ public class TagsManager implements Closeable {
|
||||
}
|
||||
|
||||
BlackboardArtifactTag addBlackboardArtifactTag = tskCase.addBlackboardArtifactTag(artifact, tagName, comment);
|
||||
Case.getCurrentCase().notifyBlackBoardArtifactTagAdded(addBlackboardArtifactTag);
|
||||
try {
|
||||
Case.getCurrentCase().notifyBlackBoardArtifactTagAdded(addBlackboardArtifactTag);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.getLogger(TagsManager.class.getName()).log(Level.WARNING, NbBundle.getMessage(TagsManager.class, "TagsManager.addBlackboardArtifactTag.noCaseWarning"));
|
||||
}
|
||||
return addBlackboardArtifactTag;
|
||||
}
|
||||
|
||||
@ -394,7 +406,11 @@ public class TagsManager implements Closeable {
|
||||
|
||||
Case.getPropertyChangeSupport().firePropertyChange(Case.Events.BLACKBOARD_ARTIFACT_TAG_DELETED.toString(), tag, null);
|
||||
tskCase.deleteBlackboardArtifactTag(tag);
|
||||
Case.getCurrentCase().notifyBlackBoardArtifactTagDeleted(tag);
|
||||
try {
|
||||
Case.getCurrentCase().notifyBlackBoardArtifactTagDeleted(tag);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.getLogger(TagsManager.class.getName()).log(Level.WARNING, NbBundle.getMessage(TagsManager.class, "TagsManager.deleteBlackboardArtifactTag.noCaseWarning"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user