Skip to content

Commit

Permalink
Fix: Check if valid data was received from websocket before assigning it
Browse files Browse the repository at this point in the history
Otherwise it can lead to exceptions in inverterData method
  • Loading branch information
tbnobody committed Sep 1, 2023
1 parent b34b22c commit 9dec05d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ export default defineComponent({
this.socket.onmessage = (event) => {
console.log(event);
this.liveData = JSON.parse(event.data);
if (event.data != "{}") {
this.liveData = JSON.parse(event.data);
}
this.dataLoading = false;
this.heartCheck(); // Reset heartbeat detection
};
Expand Down

0 comments on commit 9dec05d

Please sign in to comment.