mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
RA: fix chrome null ptr exception when extracting bookmarks
This commit is contained in:
parent
6b25b4c34b
commit
6ee69fc881
@ -179,7 +179,7 @@ public class Chrome extends Extract implements IngestModuleImage {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final JsonParser parser = new JsonParser();
|
final JsonParser parser = new JsonParser();
|
||||||
JsonElement jsonElement = parser.parse(new FileReader(temps));
|
JsonElement jsonElement = parser.parse(new FileReader(temps));
|
||||||
JsonObject jElement = jsonElement.getAsJsonObject();
|
JsonObject jElement = jsonElement.getAsJsonObject();
|
||||||
JsonObject jRoot = jElement.get("roots").getAsJsonObject();
|
JsonObject jRoot = jElement.get("roots").getAsJsonObject();
|
||||||
@ -188,9 +188,33 @@ public class Chrome extends Extract implements IngestModuleImage {
|
|||||||
for (JsonElement result : jBookmarkArray) {
|
for (JsonElement result : jBookmarkArray) {
|
||||||
try {
|
try {
|
||||||
JsonObject address = result.getAsJsonObject();
|
JsonObject address = result.getAsJsonObject();
|
||||||
String url = address.get("url").getAsString();
|
if (address == null) {
|
||||||
String name = address.get("name").getAsString();
|
continue;
|
||||||
Long date = address.get("date_added").getAsLong();
|
}
|
||||||
|
JsonElement urlEl = address.get("url");
|
||||||
|
String url = null;
|
||||||
|
if (urlEl != null) {
|
||||||
|
url = urlEl.getAsString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
url = "";
|
||||||
|
}
|
||||||
|
String name = null;
|
||||||
|
JsonElement nameEl = address.get("name");
|
||||||
|
if (nameEl != null) {
|
||||||
|
name = nameEl.getAsString();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
name = "";
|
||||||
|
}
|
||||||
|
Long date = null;
|
||||||
|
JsonElement dateEl = address.get("date_added");
|
||||||
|
if (dateEl != null) {
|
||||||
|
date = dateEl.getAsLong();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
date = Long.valueOf(0);
|
||||||
|
}
|
||||||
String domain = Util.extractDomain(url);
|
String domain = Util.extractDomain(url);
|
||||||
BlackboardArtifact bbart = bookmarkFiles.get(j).newArtifact(ARTIFACT_TYPE.TSK_WEB_BOOKMARK);
|
BlackboardArtifact bbart = bookmarkFiles.get(j).newArtifact(ARTIFACT_TYPE.TSK_WEB_BOOKMARK);
|
||||||
Collection<BlackboardAttribute> bbattributes = new ArrayList<BlackboardAttribute>();
|
Collection<BlackboardAttribute> bbattributes = new ArrayList<BlackboardAttribute>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user