From 001b6d0254014b727f541b2401f6d658563775b0 Mon Sep 17 00:00:00 2001 From: Miroslav Blasko Date: Thu, 14 Dec 2023 01:47:51 +0100 Subject: [PATCH] [Fix] Fix NPE when adding new institution to user --- src/main/java/cz/cvut/kbss/study/rest/OidcUserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cz/cvut/kbss/study/rest/OidcUserController.java b/src/main/java/cz/cvut/kbss/study/rest/OidcUserController.java index d2388d20..46321dc5 100644 --- a/src/main/java/cz/cvut/kbss/study/rest/OidcUserController.java +++ b/src/main/java/cz/cvut/kbss/study/rest/OidcUserController.java @@ -102,7 +102,7 @@ private boolean equals(HasUri entity1, HasUri entity2){ * @return the URI of the entity or null if entity is null. */ private URI getURI(HasUri entity){ - return Optional.of(entity).map(HasUri::getUri).orElse(null); + return Optional.ofNullable(entity).map(HasUri::getUri).orElse(null); } private List getByInstitution(String institutionKey) {