Automation: fix IndexOutOfBoundsException

This commit is contained in:
Milos Kozak 2022-03-26 21:47:16 +01:00
parent d33ce02e23
commit 6c49a1423c

View file

@ -292,8 +292,10 @@ class AutomationPlugin @Inject constructor(
@Synchronized
fun removeAt(index: Int) {
automationEvents.removeAt(index)
rxBus.send(EventAutomationDataChanged())
if (index >= 0 && index < automationEvents.size) {
automationEvents.removeAt(index)
rxBus.send(EventAutomationDataChanged())
}
}
@Synchronized