Skip to content

Commit 887591d

Browse files
authored
Merge pull request #19 from DaveRandom/fix-6
Fix #6
2 parents f01b29a + c37d286 commit 887591d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Decoder/Decoder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@ private function decodeDomainName(DecodingContext $decodingContext, DomainName $
261261
}
262262
}
263263

264-
if (!$labels) {
265-
throw new \UnexpectedValueException('Decode error: Empty domain name at position ' . $startIndex);
266-
}
267-
268264
$result = [];
269265
foreach ($labels as $label) {
270266
if (\is_int($label[0])) {

src/Records/Types/DomainName.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ public function getLabels($tldFirst = false): array
8181
public function setLabels(array $labels, $tldFirst = false)
8282
{
8383
if (!$labels) {
84-
throw new \InvalidArgumentException('Label list is not a valid domain name: List is empty');
84+
$this->labels = [];
85+
$this->value = '';
86+
return;
8587
}
8688

8789
$length = $count = 0;

0 commit comments

Comments
 (0)