Skip to content

Commit

Permalink
Fix - Ignore empty delta on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrofta committed Mar 27, 2024
1 parent d50484b commit 690b043
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions openweather.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ function onDeltasUpdate(deltas) {
if (deltas === null && !Array.isArray(deltas) && deltas.length === 0) {
throw "Deltas cannot be null";
}
if (deltas.updates && Array.isArray(deltas.updates))
deltas.updates.forEach(u => {
u.values.forEach((value) => {
let onDeltaUpdated = subscriptionHandler.find((d) => d.path === value.path);

deltas.updates.forEach(u => {
u.values.forEach((value) => {
let onDeltaUpdated = subscriptionHandler.find((d) => d.path === value.path);

if (onDeltaUpdated !== null) {
onDeltaUpdated.handle(value.value);
}
if (onDeltaUpdated !== null) {
onDeltaUpdated.handle(value.value);
}
});
});
});
}

function onPositionUpdate(value) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openweather-signalk",
"version": "0.8.0",
"version": "0.8.1",
"description": "SignalK plugin to provide data from OpenWeather Service",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 690b043

Please sign in to comment.