#162 Uninitialized Accelerometer reading causes null property access on first call
Opened by hyneksabacky. Modified

On the first call to a sensor wrapper, the sensor's timestamp is often null, so currentReading isn’t initialized. As a result, properties like currentReading.fake_gVector are also null.

This causes errors when the code tries to access the value currentReading.fake_gVector as an array (currentReading.fake_gVector[0] , currentReading.fake_gVector[1], currentReading.fake_gVector[2]). This happens on lines 377, 381, 408, 412, 439 and 443 in the file
https://pagure.io/JShelter/webextension/blob/main/f/common/wrappingS-SENSOR-ACCEL.js


Metadata