diff --git a/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/env/RunEnvironment.java b/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/env/RunEnvironment.java index c72b388f17..93e0abdb48 100644 --- a/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/env/RunEnvironment.java +++ b/cloudslang-runtime/src/main/java/io/cloudslang/lang/runtime/env/RunEnvironment.java @@ -215,8 +215,8 @@ public void decryptSensitiveData() { for (Value value : prepareValuesForEncryptDecrypt()) { if (value.get() instanceof HashMap) { HashMap map = (HashMap) value.get(); - for (Value valueInMap : map.values()) { - if (valueInMap.isSensitive()) { + for (Serializable valueInMap : map.values()) { + if (valueInMap instanceof Value && ((Value) valueInMap).isSensitive()) { ((SensitiveValue) valueInMap).decrypt(); } } @@ -230,8 +230,8 @@ public void encryptSensitiveData() { for (Value value : prepareValuesForEncryptDecrypt()) { if (value.get() instanceof HashMap) { HashMap map = (HashMap) value.get(); - for (Value valueInMap : map.values()) { - if (valueInMap.isSensitive()) { + for (Serializable valueInMap : map.values()) { + if (valueInMap instanceof Value && ((Value) valueInMap).isSensitive()) { ((SensitiveValue) valueInMap).encrypt(); } }