diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Startup.cs index ffc8825f1e3..9f1a6b79d20 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Startup.cs @@ -254,7 +254,7 @@ private static bool CheckOptions(ElasticConnectionOptions elasticConnectionOptio optionsAreValid = false; } - if (elasticConnectionOptions.Ports.Length == 0) + if (elasticConnectionOptions.Ports?.Length == 0) { logger.LogError("Elasticsearch is enabled but not active because a port is missing in application configuration."); optionsAreValid = false;