diff --git a/gradle.properties b/gradle.properties index 6613acdc2..bcaa15b17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ sinceIdeaBuild=232 projectVersion=1.2.1-SNAPSHOT jetBrainsToken=invalid jetBrainsChannel=stable -intellijPluginVersion=1.15.0 +intellijPluginVersion=1.16.0 intellijCommonVersion=1.9.3-SNAPSHOT telemetryPluginVersion=1.0.0.44 kotlin.stdlib.default.dependency = false diff --git a/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContexts.kt b/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContexts.kt index 9eddc46f2..d3440bf58 100644 --- a/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContexts.kt +++ b/src/main/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContexts.kt @@ -245,12 +245,13 @@ open class AllContexts( * The latter gets closed/recreated whenever the context changes in * [com.redhat.devtools.intellij.kubernetes.model.client.KubeConfigAdapter]. */ - val watcher = ConfigWatcher(path) { _, config -> onKubeConfigChanged(config) } + val watcher = ConfigWatcher(path) { _, config: io.fabric8.kubernetes.api.model.Config? -> onKubeConfigChanged(config) } runAsync(watcher::run) } - protected open fun onKubeConfigChanged(fileConfig: io.fabric8.kubernetes.api.model.Config) { + protected open fun onKubeConfigChanged(fileConfig: io.fabric8.kubernetes.api.model.Config?) { synchronized(this) { + fileConfig ?: return val client = client.get() ?: return val clientConfig = client.config.configuration if (ConfigHelper.areEqual(fileConfig, clientConfig)) { diff --git a/src/test/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContextsTest.kt b/src/test/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContextsTest.kt index aaf9aaa87..0eea1fc03 100644 --- a/src/test/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContextsTest.kt +++ b/src/test/kotlin/com/redhat/devtools/intellij/kubernetes/model/AllContextsTest.kt @@ -550,7 +550,7 @@ class AllContextsTest { } /** override with public method so that it can be tested**/ - public override fun onKubeConfigChanged(fileConfig: Config) { + public override fun onKubeConfigChanged(fileConfig: Config?) { super.onKubeConfigChanged(fileConfig) }