From 48c515ce65990d97e81d1ed7285ac420f039f7d1 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 15:43:21 +0100 Subject: [PATCH] Fix NPE for resource with pwd-as-config (MID-5046) --- .../java/com/evolveum/midpoint/common/crypto/CryptoUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java index 5ee9ab83c5a..7dde814276c 100644 --- a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java +++ b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java @@ -200,7 +200,7 @@ private static void checkEncrypted(PrismPropertyValue pval) { @SuppressWarnings("unchecked") PrismPropertyValue psPval = (PrismPropertyValue)pval; ProtectedStringType ps = psPval.getValue(); - if (ps.getClearValue() != null) { + if (ps != null && ps.getClearValue() != null) { throw new IllegalStateException("Unencrypted value in field " + propName); } } else if (itemDef.getTypeName().equals(MailConfigurationType.COMPLEX_TYPE)) {