Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ private synchronized void buildGitContentIndex(final String sha,
}

TreeWalk treeWalk = database.getTreeWalk(sha, ".json");

if (null == treeWalk) {
throw new ContentManagerException("Failed to buildGitIndex - Unable to get tree walk for SHA: " + sha);
}

log.info("Populating git content cache based on sha " + sanitiseInternalLogValue(sha) + " ...");

// Traverse the git repository looking for the .json files
Expand Down Expand Up @@ -475,7 +480,7 @@ private Content augmentChildContent(final Content content, final String canonica
media.setSrc(fixMediaSrc(canonicalSourceFile, media.getSrc()));

// for tracking purposes we want to generate an id for all image content objects.
if (media.getId() == null && media.getSrc() != null) {
if (media.getId() == null && media.getSrc() != null && parentId != null) {
media.setId(parentId + Constants.ID_SEPARATOR
+ Base64.encodeBase64String(media.getSrc().getBytes()));
}
Expand Down
Loading