From a890b089355d7374886da967cffa2214946589e6 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 28 Jul 2024 01:47:32 -0400 Subject: [PATCH] gandi: Check for JSON object, not just definedness --- ddclient.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ddclient.in b/ddclient.in index 0a30be7..a95b149 100755 --- a/ddclient.in +++ b/ddclient.in @@ -6927,9 +6927,9 @@ sub nic_gandi_update { next if !header_ok($h, $reply); $reply =~ s/^.*?\n\n//s; my $response = eval { decode_json($reply) }; - if (!defined($response)) { + if (ref($response) ne 'HASH') { $config{$h}{"status-$ipv"} = "bad"; - failed("$h: unexpected service response"); + failed("$h: response is not a JSON object: $reply"); next; } if ($response->{'rrset_values'}->[0] eq $ip && (!defined($config{$h}{'ttl'}) ||