Automation: fix ConcurrentModificationException
This commit is contained in:
parent
6c49a1423c
commit
75439f53f4
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue