Skip to content

Commit

Permalink
fix wrong check leading to subscription not being applied (#795)
Browse files Browse the repository at this point in the history
* fix wrong check leading to subscription not being applied

* fix missing preserveRetain default
  • Loading branch information
DC2-DanielKrueger authored Feb 11, 2025
1 parent 2cc2c30 commit f0c4f90
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ private static void sanitize(final @NotNull Bridge bridge) {
bridge.setSessionExpiry(3600L);
}

if (bridge.getLocalSubscriptions() != null) {
if (bridge.getLocalSubscriptions() == null) {
bridge.setLocalSubscriptions(List.of());
}

bridge.getLocalSubscriptions().forEach(BridgeResourceImpl::sanitize);

if (bridge.getRemoteSubscriptions() != null) {
if (bridge.getRemoteSubscriptions() == null) {
bridge.setRemoteSubscriptions(List.of());
}

Expand Down Expand Up @@ -543,6 +543,10 @@ private static void sanitize(final @NotNull LocalBridgeSubscription localBridgeS
localBridgeSubscription.setFilters(List.of());
}

if (localBridgeSubscription.getPreserveRetain() == null) {
localBridgeSubscription.setPreserveRetain(false);
}

}

private static void sanitize(final @NotNull BridgeSubscription bridgeSubscription) {
Expand All @@ -553,5 +557,9 @@ private static void sanitize(final @NotNull BridgeSubscription bridgeSubscriptio
if (bridgeSubscription.getFilters() == null) {
bridgeSubscription.setFilters(List.of());
}

if (bridgeSubscription.getPreserveRetain() == null) {
bridgeSubscription.setPreserveRetain(false);
}
}
}

0 comments on commit f0c4f90

Please # to comment.