From be3c2060eb3c014fc569af0a2f41381500c48d23 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 29 Jun 2024 02:14:16 -0400 Subject: [PATCH] Fix undefined hash reference warning This fixes a bug introduced in commit 5e3e10d32ec11a9cd9d1275b73e111907bdafa4c For some reason Perl is OK with: my $x = undef; my @k = keys(%$x); # empty list, no warnings but not: my $x = undef; my %h = %$x; my @k = keys(%h); --- ddclient.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddclient.in b/ddclient.in index ecfa7a6..dca3bd0 100755 --- a/ddclient.in +++ b/ddclient.in @@ -1950,7 +1950,7 @@ sub init_config { ## merge options into host definitions or globals if (@hosts) { for my $h (@hosts) { - $config{$h} = {%{$config{$h}}, %options}; + $config{$h} = {%{$config{$h} // {}}, %options}; } $opt{'host'} = join(',', @hosts); } else {