From 146943990921d9bb3758c509e57230998bafb46c 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;