From 616269bdc22cf2fd2be5d37508ced1c77dc1dcfd Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 17 Sep 2013 10:37:25 -0400 Subject: [PATCH 1/2] Added null check to ExtractUNallocAction.getUnallocFiles() --- .../autopsy/directorytree/ExtractUnallocAction.java | 5 ++++- .../sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java index 66b9b36a82..1823f84969 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java @@ -164,7 +164,10 @@ public final class ExtractUnallocAction extends AbstractAction { private List getUnallocFiles(Content c) { UnallocVisitor uv = new UnallocVisitor(); try { - return c.getChildren().get(0).accept(uv); //Launching it on the root directory + List unallocFiles = c.getChildren(); + if (unallocFiles.isEmpty() == false) { + return unallocFiles.get(0).accept(uv); //Launching it on the root directory + } } catch (TskCoreException tce) { logger.log(Level.WARNING, "Couldn't get a list of Unallocated Files, failed at sending out the visitor ", tce); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java index 696fe12d02..75c0c1c75f 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GeneralIngestConfigurator.java @@ -23,9 +23,6 @@ import java.util.List; import javax.swing.JPanel; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.coreutils.ModuleSettings; -import org.sleuthkit.autopsy.ingest.IngestDialogPanel; -import org.sleuthkit.autopsy.ingest.IngestManager; -import org.sleuthkit.autopsy.ingest.IngestModuleAbstract; import org.sleuthkit.datamodel.Content; @ServiceProvider(service = IngestConfigurator.class) From a31034043bff856a5f887212d24fdfc20ea77832 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 17 Sep 2013 10:41:21 -0400 Subject: [PATCH 2/2] Added null check to ExtractUNallocAction.getUnallocFiles() --- .../sleuthkit/autopsy/directorytree/ExtractUnallocAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java index 1823f84969..82b162d5e5 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java @@ -165,7 +165,7 @@ public final class ExtractUnallocAction extends AbstractAction { UnallocVisitor uv = new UnallocVisitor(); try { List unallocFiles = c.getChildren(); - if (unallocFiles.isEmpty() == false) { + if (null != unallocFiles && unallocFiles.isEmpty() == false) { return unallocFiles.get(0).accept(uv); //Launching it on the root directory } } catch (TskCoreException tce) {