Modified Autopsy code to take into account that getParentInfo() can now return NULL

This commit is contained in:
Eugene Livis 2018-12-06 16:44:31 -05:00
parent b98158111b
commit efcbbaf0d7
2 changed files with 11 additions and 2 deletions

View File

@ -451,7 +451,11 @@ final class IngestTasksScheduler {
boolean isInRootDir = false; boolean isInRootDir = false;
try { try {
AbstractFile parent = f.getParentDirectory(); AbstractFile parent = f.getParentDirectory();
if (parent == null) {
isInRootDir = true;
} else {
isInRootDir = parent.isRoot(); isInRootDir = parent.isRoot();
}
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.WARNING, "Error querying parent directory for" + f.getName(), ex); //NON-NLS logger.log(Level.WARNING, "Error querying parent directory for" + f.getName(), ex); //NON-NLS
} }

View File

@ -398,7 +398,12 @@ final class FileExporter {
* Is the NTFS or FAT file in the root directory? * Is the NTFS or FAT file in the root directory?
*/ */
AbstractFile parent = file.getParentDirectory(); AbstractFile parent = file.getParentDirectory();
boolean isInRootDir = parent.isRoot(); boolean isInRootDir;
if (parent == null) {
isInRootDir = true;
} else {
isInRootDir = parent.isRoot();
}
/* /*
* Check its meta-address and check its name for the '$' character * Check its meta-address and check its name for the '$' character