1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-09 20:48:33 +00:00

Fix exception handling

This commit is contained in:
Devin148
2012-11-13 15:52:35 -05:00
parent b1a7680680
commit bd0bb21330

View File

@@ -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;
}