From bd0bb2133071f5b29fa1899ec172ef2014078acd Mon Sep 17 00:00:00 2001 From: Devin148 Date: Tue, 13 Nov 2012 15:52:35 -0500 Subject: [PATCH] Fix exception handling --- .../org/sleuthkit/autopsy/coreutils/PlatformUtil.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java index 4e28f9bb64..63db61cd03 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java @@ -38,6 +38,7 @@ import org.openide.modules.Places; import org.openide.util.Exceptions; import org.sleuthkit.autopsy.casemodule.LocalDisk; import org.sleuthkit.datamodel.SleuthkitJNI; +import org.sleuthkit.datamodel.TskCoreException; /** @@ -289,10 +290,14 @@ public class PlatformUtil { int b = br.read(); if(b!=-1) { String path = "\\\\.\\PhysicalDrive" + n; - drives.add(new LocalDisk("Drive " + n, path, SleuthkitJNI.findDeviceSize(path))); + try { + drives.add(new LocalDisk("Drive " + n, path, SleuthkitJNI.findDeviceSize(path))); + } catch (TskCoreException ex) { + drives.add(new LocalDisk("Drive " + n, path, 0)); // Return a size of 0 if error + } n++; } - } catch(Exception ex) { + } catch(IOException ex) { if(breakCount > 4) { // Give up after 4 non-existent drives break; }