Skip to content

Commit 9263698

Browse files
committed
Use default state serializer content type if state is not null
Signed-off-by: Antonio Sanchez <[email protected]>
1 parent 401e121 commit 9263698

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/src/main/java/io/dapr/client/AbstractDaprClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,10 @@ public Mono<Void> saveState(String storeName, String key, Object value) {
493493
*/
494494
@Override
495495
public Mono<Void> saveState(String storeName, String key, String etag, Object value, StateOptions options) {
496-
Map<String, String> meta = Collections.singletonMap("contentType", stateSerializer.getContentType());
496+
Map<String, String> meta = null;
497+
if (value != null) {
498+
meta = Collections.singletonMap("contentType", stateSerializer.getContentType());
499+
}
497500
State<?> state = new State<>(key, value, etag, meta, options);
498501
return this.saveBulkState(storeName, Collections.singletonList(state));
499502
}

0 commit comments

Comments
 (0)