From f4ac6d532db05a9e10502d5fde27d18dfe5f9833 Mon Sep 17 00:00:00 2001 From: kikuchy Date: Sun, 20 Dec 2020 21:04:04 +0900 Subject: [PATCH] Fix the way to remove unsubscribed channels to avoid ConcurrentModificationException --- .../src/main/java/com/ninjasolutions/pusher/PusherPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/ninjasolutions/pusher/PusherPlugin.java b/android/src/main/java/com/ninjasolutions/pusher/PusherPlugin.java index c4c9534..d17b702 100644 --- a/android/src/main/java/com/ninjasolutions/pusher/PusherPlugin.java +++ b/android/src/main/java/com/ninjasolutions/pusher/PusherPlugin.java @@ -117,8 +117,8 @@ private void init(MethodCall call, Result result) { for (Map.Entry entry : channels.entrySet()) { String name = entry.getKey(); pusher.unsubscribe(name); - channels.remove(name); } + channels = new HashMap<>(); } try {