From a992fdedf4f53c26ab89c51f76730b30c2d94996 Mon Sep 17 00:00:00 2001 From: Joost Wooning Date: Mon, 14 Feb 2022 15:55:11 +0100 Subject: [PATCH] catch some errors --- src/CanExplorer.js | 4 +++- src/components/CanGraphList.js | 2 +- src/components/MessageBytes.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CanExplorer.js b/src/CanExplorer.js index e602dfb..3a68055 100644 --- a/src/CanExplorer.js +++ b/src/CanExplorer.js @@ -488,7 +488,9 @@ export default class CanExplorer extends Component { this.setState({ firstFrameTime }); } - this.addMessagesToDataCache(part, newMessages, newThumbnails); + if (newMessages) { + this.addMessagesToDataCache(part, newMessages, newThumbnails); + } // const messages = this.addAndRehydrateMessages( // newMessages, diff --git a/src/components/CanGraphList.js b/src/components/CanGraphList.js index 89d7a59..afc17c2 100644 --- a/src/components/CanGraphList.js +++ b/src/components/CanGraphList.js @@ -58,7 +58,7 @@ export default class CanGraphList extends Component { } return; } - const rect = this.plotListRef.getBoundingClientRect(); + const rect = this.plotListRef.current.getBoundingClientRect(); const draggingGraph = this.determineDraggingGraph(); if (draggingGraph) { draggingGraph.ref.hidden = true; diff --git a/src/components/MessageBytes.js b/src/components/MessageBytes.js index 99131b2..dd6daf1 100644 --- a/src/components/MessageBytes.js +++ b/src/components/MessageBytes.js @@ -29,7 +29,7 @@ export default class MessageBytes extends Component { this.props.message.entries.length - 1 ]; - return nextLastEntry.hexData !== curLastEntry.hexData; + return !nextLastEntry || !curLastEntry || nextLastEntry.hexData !== curLastEntry.hexData; } return nextProps.seekTime !== this.props.seekTime; }