Skip to content

Commit cf905bc

Browse files
authored
fix: use add if not replacing (#21109)
Use add method if not replacing an old value.
1 parent f530f76 commit cf905bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

flow-server/src/main/java/com/vaadin/flow/server/communication/UidlRequestHandler.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,17 @@ private void removeOffendingMprHashFragment(ObjectNode uidl) {
283283
}
284284

285285
if (location != null) {
286-
idx = idx >= 0 ? idx : exec.size();
287286
ArrayNode arr = JacksonUtils.createArrayNode();
288287
arr.add("");
289288
arr.add(String
290289
.format(location.startsWith("http") ? PUSH_STATE_LOCATION
291290
: PUSH_STATE_HASH, location));
292-
exec.set(idx, arr);
291+
if (idx >= 0) {
292+
exec.set(idx, arr);
293+
} else {
294+
exec.add(arr);
295+
}
296+
293297
}
294298
}
295299

0 commit comments

Comments
 (0)