Closed aaronlademann-wf closed 3 years ago
When we updated the synthetic event system to use duck typing instead of Dart is type checking, we created a possible null exception that presents as seen below when the event is null:
is
Error: Cannot use 'in' operator to search for 'key' in null
This is a regression since before we made the switch, a check like this would have simply returned false:
final someSyntheticEvent = null; final isSyntheticMouseEvent = someSyntheticEvent is SyntheticMouseEvent; // false
but now, it throws the exception when the logic is updated to:
final someSyntheticEvent = null; final isSyntheticMouseEvent = someSyntheticEvent.isMouseEvent; // throws RTE
hasProperty
_checkEventType
Problem
When we updated the synthetic event system to use duck typing instead of Dart
is
type checking, we created a possible null exception that presents as seen below when the event is null:This is a regression since before we made the switch, a check like this would have simply returned false:
but now, it throws the exception when the logic is updated to:
Solution
hasProperty
and_checkEventType
.