From d98d80f031f46be0aad4a92c2e5266504acbc44a Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 17 Feb 2017 15:32:24 -0500 Subject: [PATCH] 2306 File Types Tree will no longer blow up and disappear with non standard mimeTypes --- .../org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java index cbe842ec70..7a040847ef 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java @@ -147,7 +147,9 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi final String mime_type = resultSet.getString("mime_type"); //NON-NLS if (!mime_type.isEmpty()) { String mimeType[] = mime_type.split("/"); - if (!mimeType[0].isEmpty() && !mimeType[1].isEmpty()) { + //Note: Users are able to define custom mime types in Autopsy that do not + //contain a "/" or possibly have multiple slashes + if (mimeType.length > 1 && !mimeType[0].isEmpty() && !mimeType[1].isEmpty()) { if (!existingMimeTypes.containsKey(mimeType[0])) { existingMimeTypes.put(mimeType[0], new ArrayList<>()); }