Skip to content

Commit 6b088bd

Browse files
committed
udpate string handling
1 parent f2ce6ae commit 6b088bd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎client/src/main/java/com/microsoft/durabletask/FailureDetails.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ private static Value convertToProtoValue(@Nullable Object obj) {
341341
} else if (obj instanceof Map) {
342342
Struct.Builder structBuilder = Struct.newBuilder();
343343
for (Map.Entry<?, ?> entry : ((Map<?, ?>) obj).entrySet()) {
344-
structBuilder.putFields((String) entry.getKey(), convertToProtoValue(entry.getValue()));
344+
Object key = entry.getKey();
345+
if (!(key instanceof String)) {
346+
throw new IllegalArgumentException("Failure property map keys must be strings.");
347+
}
348+
structBuilder.putFields((String) key, convertToProtoValue(entry.getValue()));
345349
}
346350
return Value.newBuilder().setStructValue(structBuilder).build();
347351
} else {

0 commit comments

Comments
 (0)