diff --git a/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/runner/functions/FunctionRunConfigurationProducer.java b/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/runner/functions/FunctionRunConfigurationProducer.java index ec1843703f..d9f41911ef 100644 --- a/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/runner/functions/FunctionRunConfigurationProducer.java +++ b/PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/intellij/runner/functions/FunctionRunConfigurationProducer.java @@ -55,17 +55,17 @@ public ConfigurationFactory getConfigurationFactory() { } @Override - protected boolean setupConfigurationFromContext(AzureRunConfigurationBase configuration, ConfigurationContext context, Ref ref) { - if (!(configuration instanceof FunctionRunConfiguration || configuration instanceof FunctionDeployConfiguration)) { + protected boolean setupConfigurationFromContext(AzureRunConfigurationBase runConfigurationBase, ConfigurationContext context, Ref ref) { + if (!(runConfigurationBase instanceof FunctionRunConfiguration || runConfigurationBase instanceof FunctionDeployConfiguration)) { return false; } - final Location contextLocation = context.getLocation(); assert contextLocation != null; Location methodLocation = getAzureFunctionMethods(contextLocation); if (methodLocation == null) { return false; } + AzureRunConfigurationBase configuration = runConfigurationBase; if (configuration instanceof FunctionDeployConfiguration) { final RunManagerEx manager = RunManagerEx.getInstanceEx(context.getProject()); // since deploy configuration doesn't support, we need to create a FunctionRunConfiguration @@ -85,6 +85,8 @@ protected boolean setupConfigurationFromContext(AzureRunConfigurationBase config final Module module = findModule(runConfiguration, contextModule); if (module != null) { runConfiguration.initializeDefaults(module); + } else { + return false; } } if (StringUtils.isBlank(configuration.getName())) {