Skip to content

Commit

Permalink
Merge pull request #19 from DaveRandom/fix-6
Browse files Browse the repository at this point in the history
Fix #6
  • Loading branch information
DaveRandom authored Jan 10, 2018
2 parents f01b29a + c37d286 commit 887591d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/Decoder/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ private function decodeDomainName(DecodingContext $decodingContext, DomainName $
}
}

if (!$labels) {
throw new \UnexpectedValueException('Decode error: Empty domain name at position ' . $startIndex);
}

$result = [];
foreach ($labels as $label) {
if (\is_int($label[0])) {
Expand Down
4 changes: 3 additions & 1 deletion src/Records/Types/DomainName.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public function getLabels($tldFirst = false): array
public function setLabels(array $labels, $tldFirst = false)
{
if (!$labels) {
throw new \InvalidArgumentException('Label list is not a valid domain name: List is empty');
$this->labels = [];
$this->value = '';
return;
}

$length = $count = 0;
Expand Down

0 comments on commit 887591d

Please sign in to comment.