From 3461ed60990fc91e399ef3c4cd082029db2059dd Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 15 Feb 2024 16:02:22 +0100 Subject: [PATCH] Fix: don't measure compass if alpha is null, fix #1787 --- src/Sensors/Orientation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Sensors/Orientation.ts b/src/Sensors/Orientation.ts index ca71cf2b51..e9d28ffd3f 100644 --- a/src/Sensors/Orientation.ts +++ b/src/Sensors/Orientation.ts @@ -77,6 +77,9 @@ export class Orientation { } private update(event: DeviceOrientationEvent) { + if(event.alpha === null || event.beta === null || event.gamma === null){ + return + } this.gotMeasurement.setData(true) // IF the phone is lying flat, then: // alpha is the compass direction (but not absolute)