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

This commit is contained in:
Sam El-Husseini committed 2018-01-02 22:22:14 -08:00
1 parent 81bfca4ed6
commit 3c4c38eb59
3 files changed
+13 -3

No files matched your search

+1
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