Skip to content

Commit 4e57aef

Browse files
committed
fix: npe warning during build
1 parent 4c338a2 commit 4e57aef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/src/main/kotlin/spp/jetbrains/sourcemarker/config/SourceMarkerConfigurable.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package spp.jetbrains.sourcemarker.config
1818

1919
import com.intellij.ide.util.PropertiesComponent
20+
import com.intellij.openapi.application.ApplicationManager
2021
import com.intellij.openapi.options.Configurable
2122
import com.intellij.openapi.project.DumbService
2223
import com.intellij.openapi.project.Project
@@ -55,16 +56,16 @@ class SourceMarkerConfigurable(val project: Project) : Configurable {
5556
}
5657
}
5758

58-
override fun createComponent(): JComponent {
59-
if (form == null) {
59+
override fun createComponent(): JComponent? {
60+
if (form == null && !ApplicationManager.getApplication().isHeadlessEnvironment) {
6061
val config = SourceMarkerPlugin.getInstance(project).getConfig()
6162
val availServices = safeRunBlocking {
6263
UserData.liveManagementService(project).getServices().await()
6364
}
6465
form = PluginConfigurationPanel(config, availServices)
6566
form!!.applySourceMarkerConfig(config)
6667
}
67-
return form!!.contentPane as JComponent
68+
return form?.contentPane
6869
}
6970

7071
override fun disposeUIResources() {

0 commit comments

Comments
 (0)