Skip to content

Commit

Permalink
MGR-89 avoid NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
madness-inc committed Apr 3, 2020
1 parent e5cca4b commit bb53bf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Expand Up @@ -160,18 +160,20 @@ public class PropertyWrapper extends PropertyImpl {
}

public String getDisplayValue() {
if(Property.Type.MULTILINE.equals(getType())) {
if (Property.Type.MULTILINE.equals(getType())) {
return getClob();
}
return getActualString();
}

@Override
public String getActualString() {
String stringValue = getString();
if (hidePassword && Property.Type.PASSWORD.equals(getType())) {
return getString().replaceAll("\\.", "*");
return stringValue.substring(0, 2) + StringUtils.repeat('*', stringValue.length() - 4)
+ stringValue.substring(stringValue.length() - 2);
}
return getString();
return stringValue;
}

@Override
Expand Down
Expand Up @@ -75,8 +75,8 @@ public void validate(Site site, Application application, Environment environment
}
if (Property.Type.BOOLEAN.equals(getProperty().getType())) {
String stringValue = getProperty().getString();
boolean value = stringValue.equalsIgnoreCase("on") || stringValue.equalsIgnoreCase("true");
getProperty().setValue(value);
boolean selected = StringUtils.equalsAnyIgnoreCase(stringValue, "on", "true");
getProperty().setValue(selected);
}
}

Expand Down

0 comments on commit bb53bf1

Please sign in to comment.