From d36f8192875f31d293fc1a6a533ce412870f006b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 22:47:28 +0200 Subject: [PATCH] fix concurrent modification --- .../plugins/general/automation/triggers/TriggerBTDevice.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt index 02133d03d2..0a96be811b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt @@ -86,7 +86,7 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { } private fun eventExists(): Boolean { - automationPlugin.btConnects.forEach { + ArrayList(automationPlugin.btConnects).forEach { if (btDevice.value == it.deviceName) { if (comparator.value == ComparatorConnect.Compare.ON_CONNECT && it.state == EventBTChange.Change.CONNECT) return true if (comparator.value == ComparatorConnect.Compare.ON_DISCONNECT && it.state == EventBTChange.Change.DISCONNECT) return true