KEYCLOAK-15545 Fix null pointer exception when updating flow via API

This commit is contained in:
Trey Dockendorf 2020-09-23 09:42:11 -04:00 committed by Hynek Mlnařík
parent f274ec447b
commit 6e713b5044

View file

@ -278,12 +278,16 @@ public class AuthenticationManagementResource {
}
//if the name changed
if (!checkFlow.getAlias().equals(flow.getAlias())) {
if (checkFlow.getAlias() != null && !checkFlow.getAlias().equals(flow.getAlias())) {
checkFlow.setAlias(flow.getAlias());
} else if (checkFlow.getAlias() == null && flow.getAlias() != null) {
checkFlow.setAlias(flow.getAlias());
}
//check if the description changed
if (!checkFlow.getDescription().equals(flow.getDescription())) {
if (checkFlow.getDescription() != null && !checkFlow.getDescription().equals(flow.getDescription())) {
checkFlow.setDescription(flow.getDescription());
} else if (checkFlow.getDescription() == null && flow.getDescription() != null) {
checkFlow.setDescription(flow.getDescription());
}