avoid ConcurrentModificationException

This commit is contained in:
Milos Kozak 2021-01-17 15:46:03 +01:00
parent 68faba8951
commit 3f561943dc

View file

@ -193,7 +193,9 @@ class AutomationPlugin @Inject constructor(
}
aapsLogger.debug(LTag.AUTOMATION, "processActions")
for (event in automationEvents) {
val iterator = automationEvents.iterator()
while (iterator.hasNext()) {
val event = iterator.next()
if (event.isEnabled && event.shouldRun() && event.trigger.shouldRun() && event.getPreconditions().shouldRun()) {
if (event.systemAction || userEventsEnabled) {
val actions = event.actions