From b204fbef0f0f138b98b85d98cf1e7224e5738f7e Mon Sep 17 00:00:00 2001 From: ThorOdinson246 <110178596+ThorOdinson246@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:57:04 -0500 Subject: [PATCH] guard against undefined previousValue on first network reading --- values.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/values.js b/values.js index 1255e8c..e66687e 100644 --- a/values.js +++ b/values.js @@ -421,8 +421,9 @@ export const Values = GObject.registerClass({ key: '__' + type + '_ses__', }); - // calculate speed for this interface - let speed = (value - previousValue[1]) / dwell; + // calculate speed for this interface - there is nothing to compare + // against the very first time an interface is seen + let speed = (previousValue)?(value - previousValue[1]) / dwell:0; let speedFormatted = this._legible(speed, 'speed', type); output.push({ label,