Skip to content

Commit

Permalink
Merge branch '630-detailsError' of https://github.com/hbz/nwbib
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Oct 19, 2023
2 parents 241c029 + 2319161 commit 7968101
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/views/TableRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,18 @@ String[] refAndLabel(String property, String value,
}
String label =
labels.isPresent() && labels.get().size() > 0 ? labels.get().get(0)
: value.startsWith("http") ? URI.create(value).getHost() : value;
: value.startsWith("http") ? hostFromUri(value) : value;
return new String[] { value, label };
}

private static String hostFromUri(String value) {
try {
return URI.create(value).getHost();
} catch (IllegalArgumentException e) {
return value;
}
}

public abstract String process(JsonNode doc, String property, String param,
String label, List<String> values, Optional<List<String>> labels);
}

0 comments on commit 7968101

Please sign in to comment.