diff --git a/haxe/ui/util/EventMap.hx b/haxe/ui/util/EventMap.hx index 658fe8535..48b4a8161 100644 --- a/haxe/ui/util/EventMap.hx +++ b/haxe/ui/util/EventMap.hx @@ -17,8 +17,10 @@ class EventMap { public function removeAll(type:EventType = null) { if (type != null) { - _map.get(type).removeAll(); - _map.remove(type); + if (_map.exists(type)) { + _map.get(type).removeAll(); + _map.remove(type); + } } else { for (type in _map.keys()) { _map.get(type).removeAll();