mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Merge pull request #1797 from BasisOlivers/develop
Fixed unhandled IllegalArgumentException
This commit is contained in:
commit
3c094facb4
@ -45,7 +45,6 @@ public class FileTypeDetector {
|
||||
private static final int BUFFER_SIZE = 64 * 1024;
|
||||
private final byte buffer[] = new byte[BUFFER_SIZE];
|
||||
private final List<FileType> userDefinedFileTypes;
|
||||
private static Blackboard blackboard;
|
||||
private static final Logger logger = Logger.getLogger(FileTypeDetector.class.getName());
|
||||
|
||||
/**
|
||||
@ -174,7 +173,6 @@ public class FileTypeDetector {
|
||||
* @throws TskCoreException
|
||||
*/
|
||||
public String detect(AbstractFile file) throws TskCoreException {
|
||||
blackboard = Case.getCurrentCase().getServices().getBlackboard();
|
||||
// consistently mark non-regular files (refer TskData.TSK_FS_META_TYPE_ENUM),
|
||||
// 0 sized files, unallocated, and unused blocks (refer TskData.TSK_DB_FILES_TYPE_ENUM)
|
||||
// as octet-stream.
|
||||
@ -247,11 +245,13 @@ public class FileTypeDetector {
|
||||
|
||||
try {
|
||||
// index the artifact for keyword search
|
||||
blackboard.indexArtifact(artifact);
|
||||
Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact);
|
||||
} catch (Blackboard.BlackboardException ex) {
|
||||
logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", artifact.getDisplayName()), ex); //NON-NLS
|
||||
MessageNotifyUtil.Notify.error(
|
||||
NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName());
|
||||
} catch (IllegalStateException ex) {
|
||||
throw new TskCoreException("There is no current case.");
|
||||
}
|
||||
}
|
||||
return fileType.getMimeType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user