From 371b00a9dcba1989450482a32f1d533ff8079b04 Mon Sep 17 00:00:00 2001 From: Raman Date: Thu, 29 Nov 2018 11:53:07 -0500 Subject: [PATCH] 1142: fix DrawableFile.getDataSource() --- .../autopsy/imagegallery/datamodel/DrawableFile.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 4b777b387d..438ace44d5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -158,7 +158,11 @@ public abstract class DrawableFile { } public DataSource getDataSource() throws TskCoreException, TskDataException { - return getSleuthkitCase().getDataSource(file.getDataSource().getId()); + if (file.getDataSource() instanceof DataSource) { + return (DataSource)file.getDataSource(); + } else { + throw new TskCoreException(String.format("Failed to get data source for drawable file (id = %s)", file.getId())); + } } private Pair, Collection> makeAttributeValuePair(DrawableAttribute attribute) {