From 14d0089c32cee1ef87f08152b891ce70e420201e Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 12 Dec 2023 13:13:46 -0800 Subject: [PATCH] Prevent an exception when no Elasticsearch port provided (#14887) --- .../OrchardCore.Search.Elasticsearch/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;