Skip to content

Commit

Permalink
Bugfix for Nullpointer URL validation
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Oct 22, 2023
1 parent 4ca0cf2 commit 2beb4bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/main/java/access/api/RoleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -137,7 +138,7 @@ public ResponseEntity<Void> deleteRole(@PathVariable("id") Long id, @Parameter(h
}

private ResponseEntity<Role> saveOrUpdate(Role role, User user) {
if (!urlFormatValidator.isValid(role.getLandingPage())) {
if (StringUtils.hasText(role.getLandingPage()) && !urlFormatValidator.isValid(role.getLandingPage())) {
throw new InvalidInputException();
}
Map<String, Object> provider = manage.providerById(role.getManageType(), role.getManageId());
Expand Down

0 comments on commit 2beb4bb

Please sign in to comment.