Merge pull request #5671 from gdicristofaro/6091-NPE-in-log-from-TSK_DATA_SOURCE_USAGE

use content by id to fetch display name for BlackboardArtifactNode
This commit is contained in:
Richard Cordovano 2020-03-04 12:58:31 -05:00 committed by GitHub
commit 146e3661a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,7 +323,8 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
if (displayName.isEmpty() && artifact != null) {
try {
displayName = Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(this.artifact.getObjectID()).getName();
Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(this.artifact.getObjectID());
displayName = (content == null) ? artifact.getName() : content.getName();
} catch (TskCoreException | NoCurrentCaseException ex) {
displayName = artifact.getName();
}