Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
checking for null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
leodotcloud authored and Alena Prokharchyk committed Oct 1, 2019
1 parent f4d4d33 commit 436e55d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ public class SecretValidationFilter extends AbstractDefaultResourceManagerFilter
@Override
public Object create(String type, ApiRequest request, ResourceManager next) {
Secret s = request.proxyRequestObject(Secret.class);
if (!Base64.isBase64(s.getValue())) {
String secretValue = s.getValue();
if (secretValue == null) {
throw new ValidationErrorException("EmptySecret", "value", "Secret cannot be empty");
}
if (!Base64.isBase64(secretValue)) {
throw new ValidationErrorException("InvalidBase64", "value", "Invalid base64 content");

};
Expand Down

0 comments on commit 436e55d

Please sign in to comment.