Automation: prevent ConcurrentModificationException

This commit is contained in:
Milos Kozak 2022-04-04 09:25:43 +02:00
parent 77151766cd
commit a60c72ee17

View file

@ -150,7 +150,7 @@ class AutomationPlugin @Inject constructor(
private fun storeToSP() { private fun storeToSP() {
val array = JSONArray() val array = JSONArray()
val iterator = automationEvents.iterator() val iterator = ArrayList<AutomationEvent>(automationEvents).iterator()
try { try {
while (iterator.hasNext()) { while (iterator.hasNext()) {
val event = iterator.next() val event = iterator.next()