Fix null dereferencing issue. Fix sensor mode changed not clearing cached control.

This commit is contained in:
Sam El-Husseini
2018-01-02 22:22:14 -08:00
parent 81bfca4ed6
commit 3c4c38eb59
3 changed files with 13 additions and 3 deletions

View File

@ -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