Automation: fix ConcurrentModificationException

This commit is contained in:
Milos Kozak 2022-03-26 21:52:30 +01:00
parent 6c49a1423c
commit 75439f53f4

View file

@ -150,8 +150,10 @@ class AutomationPlugin @Inject constructor(
private fun storeToSP() {
val array = JSONArray()
val iterator = automationEvents.iterator()
try {
for (event in automationEvents) {
while (iterator.hasNext()) {
val event = iterator.next()
array.put(JSONObject(event.toJSON()))
}
} catch (e: JSONException) {