Fix null dereferencing issue. Fix sensor mode changed not clearing cached control.
This commit is contained in:
@ -94,6 +94,7 @@ namespace sensors {
|
||||
}
|
||||
|
||||
_update(prev: number, curr: number) {
|
||||
if (curr == null) return;
|
||||
if (this.mode == ColorSensorMode.Color)
|
||||
control.raiseEvent(this._id, this._colorEventValue(curr));
|
||||
else
|
||||
|
Reference in New Issue
Block a user