Skip to content

Commit

Permalink
NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmalloy committed Mar 20, 2024
1 parent ed043f6 commit 01d246e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/jasper/service/RefService.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ public Instant patch(String url, String origin, Instant cursor, Patch patch) {
try {
var patched = patch.apply(objectMapper.convertValue(ref, JsonNode.class));
var updated = objectMapper.treeToValue(patched, Ref.class);
// Tolerate duplicate tags
updated.setTags(new ArrayList<>(new LinkedHashSet<>(updated.getTags())));
if (updated.getTags() != null) {
// Tolerate duplicate tags
updated.setTags(new ArrayList<>(new LinkedHashSet<>(updated.getTags())));
}
// @PreAuthorize annotations are not triggered for calls within the same class
if (!auth.canWriteRef(updated)) throw new AccessDeniedException("Can't add new tags");
if (created) {
Expand Down

0 comments on commit 01d246e

Please sign in to comment.