Update Chromium.java

Add base directory to profile.  Fix NPE in bookmarks
This commit is contained in:
Mark McKinnon 2024-04-16 21:10:04 -04:00
parent bf041ab06c
commit c913237966

View File

@ -320,6 +320,8 @@ class Chromium extends Extract {
jProfile = jElement.get("profile").getAsJsonObject(); //NON-NLS jProfile = jElement.get("profile").getAsJsonObject(); //NON-NLS
jInfoCache = jProfile.get("info_cache").getAsJsonObject(); jInfoCache = jProfile.get("info_cache").getAsJsonObject();
} else { } else {
userProfiles.put(browserLocation, "Default");
browserLocations.put(browserLocation, browser);
continue; continue;
} }
} catch (JsonIOException | JsonSyntaxException | IllegalStateException ex) { } catch (JsonIOException | JsonSyntaxException | IllegalStateException ex) {
@ -854,6 +856,7 @@ class Chromium extends Extract {
Set<String> bookmarkKeys = jRoot.keySet(); Set<String> bookmarkKeys = jRoot.keySet();
for (String bookmarkKey : bookmarkKeys) { for (String bookmarkKey : bookmarkKeys) {
JsonObject jBookmark = jRoot.get(bookmarkKey).getAsJsonObject(); //NON-NLS JsonObject jBookmark = jRoot.get(bookmarkKey).getAsJsonObject(); //NON-NLS
if (jBookmark.has("children")) {
JsonArray jBookmarkArray = jBookmark.getAsJsonArray("children"); //NON-NLS JsonArray jBookmarkArray = jBookmark.getAsJsonArray("children"); //NON-NLS
for (JsonElement result : jBookmarkArray) { for (JsonElement result : jBookmarkArray) {
JsonObject address = result.getAsJsonObject(); JsonObject address = result.getAsJsonObject();
@ -908,6 +911,7 @@ class Chromium extends Extract {
} }
} }
}
if (!context.dataSourceIngestIsCancelled()) { if (!context.dataSourceIngestIsCancelled()) {
postArtifacts(bbartifacts); postArtifacts(bbartifacts);