From 4328597641fb98d7c56eea10f1e3222c7c20791c Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 21 Jan 2023 23:50:03 +0100 Subject: [PATCH] fix startup crash --- .../info/nightscout/implementation/plugin/PluginStore.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt b/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt index 62b70ab7ce..bfb809e74a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt +++ b/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt @@ -187,7 +187,10 @@ class PluginStore @Inject constructor( get() = activeAPSStore ?: checkNotNull(activeAPSStore) { "No APS selected" } override val activePump: Pump - get() = activePumpStore ?: checkNotNull(activePumpStore) { "No pump selected" } + get() = activePumpStore + // Following line can be used only during initialization + ?: getTheOneEnabledInArray(getSpecificPluginsList(PluginType.PUMP), PluginType.PUMP) as Pump? + ?: checkNotNull(activePumpStore) { "No pump selected" } override val activeSensitivity: Sensitivity get() = activeSensitivityStore