Skip to content

Commit

Permalink
dont removeAll if entry doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Nov 14, 2023
1 parent 048997d commit bd985d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions haxe/ui/util/EventMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class EventMap {

public function removeAll<T:UIEvent>(type:EventType<T> = 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();
Expand Down

0 comments on commit bd985d9

Please sign in to comment.