From bd985d929fa79fbee6c7a89c222ba78ad44f71f0 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Tue, 14 Nov 2023 22:56:35 +0100 Subject: [PATCH] dont removeAll if entry doesnt exist --- haxe/ui/util/EventMap.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();