fix concurrent modification

This commit is contained in:
Milos Kozak 2022-07-21 22:47:28 +02:00
parent 6c4796fd21
commit d36f819287

View file

@ -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