mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
Merge pull request #7370 from markmckinnon/8190-NumberFormatException-in-RecentAvtivity
8190-NumberFormatException-in-RecentAvtivity
This commit is contained in:
commit
0bfeb857cb
@ -567,7 +567,7 @@ class ExtractRegistry extends Extract {
|
|||||||
Long mtime = null;
|
Long mtime = null;
|
||||||
if (timenodes.getLength() > 0) {
|
if (timenodes.getLength() > 0) {
|
||||||
Element timenode = (Element) timenodes.item(0);
|
Element timenode = (Element) timenodes.item(0);
|
||||||
String etime = timenode.getTextContent();
|
String etime = timenode.getTextContent().trim();
|
||||||
//sometimes etime will be an empty string and therefore can not be parsed into a date
|
//sometimes etime will be an empty string and therefore can not be parsed into a date
|
||||||
if (etime != null && !etime.isEmpty()) {
|
if (etime != null && !etime.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
@ -783,9 +783,14 @@ class ExtractRegistry extends Extract {
|
|||||||
break;
|
break;
|
||||||
case "usb": //NON-NLS
|
case "usb": //NON-NLS
|
||||||
try {
|
try {
|
||||||
Long usbMtime = Long.parseLong(artnode.getAttribute("mtime")); //NON-NLS
|
Long usbMtime = Long.valueOf("0");
|
||||||
|
if (!artnode.getAttribute("mtime").isEmpty()) {
|
||||||
|
usbMtime = Long.parseLong(artnode.getAttribute("mtime")); //NON-NLS
|
||||||
|
}
|
||||||
usbMtime = Long.valueOf(usbMtime.toString());
|
usbMtime = Long.valueOf(usbMtime.toString());
|
||||||
|
if (usbMtime > 0) {
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, parentModuleName, usbMtime));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME, parentModuleName, usbMtime));
|
||||||
|
}
|
||||||
String dev = artnode.getAttribute("dev"); //NON-NLS
|
String dev = artnode.getAttribute("dev"); //NON-NLS
|
||||||
String make = "";
|
String make = "";
|
||||||
String model = dev;
|
String model = dev;
|
||||||
@ -801,7 +806,7 @@ class ExtractRegistry extends Extract {
|
|||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_MAKE, parentModuleName, make));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_MAKE, parentModuleName, make));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_MODEL, parentModuleName, model));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_MODEL, parentModuleName, model));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_ID, parentModuleName, value));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DEVICE_ID, parentModuleName, value));
|
||||||
newArtifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_DEVICE_ATTACHED, regFile, bbattributes));
|
newArtifacts.add(createArtifactWithAttributes(ARTIFACT_TYPE.TSK_DEVICE_ATTACHED, regFile, bbattributes));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, String.format("Error adding device_attached artifact to blackboard for file %d.", regFile.getId()), ex); //NON-NLS
|
logger.log(Level.SEVERE, String.format("Error adding device_attached artifact to blackboard for file %d.", regFile.getId()), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user