Error-proof HashLookupSettingsPanel.isLocalIngestJobEvent()

This commit is contained in:
rcordovano 2015-04-24 10:08:51 -04:00
parent 3cdfbf6934
commit de360793f9

View File

@ -229,7 +229,16 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
}
private boolean isLocalIngestJobEvent(PropertyChangeEvent evt) {
return evt instanceof AutopsyEvent && ((AutopsyEvent)evt).getSourceType() == AutopsyEvent.SourceType.LOCAL;
if (evt instanceof AutopsyEvent) {
AutopsyEvent event = (AutopsyEvent) evt;
if (event.getSourceType() == AutopsyEvent.SourceType.LOCAL) {
String eventType = event.getPropertyName();
return (eventType.equals(IngestManager.IngestJobEvent.STARTED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()));
}
}
return false;
}
@Override