Skip to content

Commit 5d5376d

Browse files
committed
fix bug assuming merge thing always and only operates on json objects
1 parent 49cd118 commit 5d5376d

File tree

1 file changed

+2
-1
lines changed
  • things/service/src/main/java/org/eclipse/ditto/things/service/persistence/actors/strategies/commands

1 file changed

+2
-1
lines changed

things/service/src/main/java/org/eclipse/ditto/things/service/persistence/actors/strategies/commands/MergeThingStrategy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ private Result<ThingEvent<?>> applyMergeCommand(final Context<ThingId> context,
148148

149149
final JsonValue finalMergeValue = applyEmptyObjectRemovalIfConfigured(mergeValue);
150150

151-
if (removeEmptyObjectsAfterPatchConditionFiltering && finalMergeValue.asObject().isEmpty()) {
151+
if (removeEmptyObjectsAfterPatchConditionFiltering &&
152+
finalMergeValue.isObject() && finalMergeValue.asObject().isEmpty()) {
152153
final CompletionStage<WithDittoHeaders> responseStage = CompletableFuture.completedFuture(
153154
appendETagHeaderIfProvided(command, MergeThingResponse.of(command.getEntityId(), path,
154155
createCommandResponseDittoHeaders(dittoHeaders, nextRevision)), thing)

0 commit comments

Comments
 (0)