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) {