IdeaGinkgo / Intellij-Ginkgo

Idea plugin for running and viewing ginkgo tests
GNU General Public License v3.0
34 stars 13 forks source link

NullPointerException in GinkgoRunConfigurationOptions.findGinkgoByEnv #55

Open adammw opened 2 years ago

adammw commented 2 years ago

Encountered this NullPointerException when opening a new non-Go project. I'm guessing that somehow my environment wasn't configured for Go but the plugin still ran and then crashed when GoEnvironmentUtil.retrieveGoBinFromEnvironment returned nil.

Stack Trace update failed for AnAction(com.intellij.execution.ExecutorRegistryImpl$ExecutorAction, id=Run) with text=Run java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:208) at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263) at java.base/java.nio.file.Path.of(Path.java:147) at java.base/java.nio.file.Paths.get(Paths.java:69) at com.github.idea.ginkgo.GinkgoRunConfigurationOptions.findGinkgoByEnv(GinkgoRunConfigurationOptions.java:169) at com.github.idea.ginkgo.GinkgoRunConfigurationOptions.findGinkgoExecutable(GinkgoRunConfigurationOptions.java:145) at com.github.idea.ginkgo.GinkgoRunConfigurationOptions.(GinkgoRunConfigurationOptions.java:35) at com.github.idea.ginkgo.GinkgoRunConfiguration.(GinkgoRunConfiguration.java:25) at com.github.idea.ginkgo.GinkgoConfigurationType.createTemplateConfiguration(GinkgoConfigurationType.java:26) at com.intellij.execution.configurations.ConfigurationFactory.createTemplateConfiguration(ConfigurationFactory.java:64) at com.intellij.execution.impl.RunManagerImpl.createTemplateSettings$intellij_platform_execution_impl(RunManagerImpl.kt:355) at com.intellij.execution.impl.RunManagerImpl.getConfigurationTemplate(RunManagerImpl.kt:347) at com.intellij.execution.impl.RunManagerImpl.createConfiguration(RunManagerImpl.kt:272) at com.intellij.execution.actions.RunConfigurationProducer.cloneTemplateConfigurationStatic(RunConfigurationProducer.java:257) at com.intellij.execution.actions.RunConfigurationProducer.cloneTemplateConfiguration(RunConfigurationProducer.java:247) at com.intellij.execution.actions.RunConfigurationProducer.createConfigurationFromContext(RunConfigurationProducer.java:96) at com.intellij.execution.actions.PreferredProducerFind.doGetConfigurationsFromContext(PreferredProducerFind.java:119) at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:100) at com.intellij.execution.actions.ConfigurationContext.createConfigurationsFromContext(ConfigurationContext.java:423) at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunConfigsForCurrentFile(ExecutorRegistryImpl.java:462) at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunCurrentFileActionStatus(ExecutorRegistryImpl.java:408) at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunCurrentFileActionStatus(ExecutorRegistryImpl.java:387) at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.update(ExecutorRegistryImpl.java:345) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:150) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:173) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:654) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$4(ActionUpdater.java:128) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:172) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:153) at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:129) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:116) at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:643) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:493) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:472) at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:472) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:545) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:472) at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:472) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:545) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:472) at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:472) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:271) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$12(ActionUpdater.java:335) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$13(ActionUpdater.java:354) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1154) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$tryRunReadActionAndCancelBeforeWrite$17(ActionUpdater.java:386) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158) at com.intellij.openapi.actionSystem.impl.ActionUpdater.tryRunReadActionAndCancelBeforeWrite(ActionUpdater.java:382) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$14(ActionUpdater.java:354) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:365) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$15(ActionUpdater.java:353) at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:241) at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31) at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:214) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212) at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:203) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833)
TaylorOno commented 2 years ago

I'm honestly kinda confused how this happens. Oh well I'll add a catch