Skip to content

Commit

Permalink
fix switch back to 0 in HTP merging
Browse files Browse the repository at this point in the history
Value `0` was never set since the condition to be smaller than the reference `0` is never met. This led to being `undefined` and missing keys within the change-events.
  • Loading branch information
mutec committed Nov 10, 2024
1 parent 767dfc9 commit 7ae3364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/merging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class MergingReceiver extends Receiver {
) {
for (let ch = 1; ch <= 512; ch += 1) {
const newValue = packet.payload[ch] || 0;
if ((mergedData[ch] ?? 0) < newValue) {
if ((mergedData[ch] ?? 0) <= newValue) {
mergedData[ch] = newValue;
}
}
Expand Down

0 comments on commit 7ae3364

Please sign in to comment.