1 parent d9009df commit 928f606Copy full SHA for 928f606
1 file changed
src/PurplePixie/PhpDns/DNSQuery.php
@@ -200,10 +200,11 @@ private function readRecord(): array
200
201
$ans_header = unpack('ntype/nclass/Nttl/nlength', $ans_header_bin);
202
203
- $this->debug(
+ if (is_array($ans_header)) $this->debug(
204
'Record Type ' . $ans_header['type'] . ' Class ' . $ans_header['class'] .
205
' TTL ' . $ans_header['ttl'] . ' Length ' . $ans_header['length']
206
);
207
+ else $this->debug("Error unpacking answer header, no array returned.");
208
209
$typeId = $ans_header['type'];
210
0 commit comments