Skip to content

Commit

Permalink
🐛 clean up empty 'Derived from'
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Nov 30, 2023
1 parent 4499892 commit 7ab3296
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ protected String findSourceText(IndexType type, JsonNode jsonElement) {
JsonNode copyElement = Fields._copy.getFrom(jsonElement);
String copyOf = SourceField.name.getTextOrNull(copyElement);
String copySrc = SourceField.source.getTextOrNull(copyElement);
String copiedFrom = Fields._copiedFrom.getTextOrNull(copyElement);

if (copyOf != null) {
srcText.add(String.format("Derived from %s (%s)", copyOf, copySrc));
} else if (Fields._copiedFrom.existsIn(jsonElement)) {
srcText.add(String.format("Derived from %s", Fields._copiedFrom.getTextOrEmpty(copyElement)));
} else if (copiedFrom != null) {
srcText.add(String.format("Derived from %s", copiedFrom));
}

// find/add additional sources
Expand Down

0 comments on commit 7ab3296

Please sign in to comment.