From 5e20254eae2d2dbda7fb3811f5c3d9d4d9391b61 Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <andreas.romeyke@slub-dresden.de>
Date: Mon, 14 Apr 2025 18:17:44 +0200
Subject: [PATCH] - added check if host is defined

---
 lib/SLUB/LZA/TA/Archivematica/Elasticsearch.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/SLUB/LZA/TA/Archivematica/Elasticsearch.pm b/lib/SLUB/LZA/TA/Archivematica/Elasticsearch.pm
index a13ba38..b807d00 100644
--- a/lib/SLUB/LZA/TA/Archivematica/Elasticsearch.pm
+++ b/lib/SLUB/LZA/TA/Archivematica/Elasticsearch.pm
@@ -19,6 +19,7 @@ our @EXPORT_OK = qw();
 #$Search::Elasticsearch::Error::DEBUG=2;
 
 sub _instantiate($protocol, $host, $port) {
+    die "No host configuration found, missed config-file or command line parameter?\nHint: check '$0' help init'\n" unless defined $host;
     return Search::Elasticsearch->new(
         nodes    => "$protocol://$host:$port",
         #trace_to => 'Stderr',
-- 
GitLab