Skip to content

Commit

Permalink
Fix Element::getValue() not handling possible nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Mar 2, 2022
1 parent aba5141 commit b5eebae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip

- Changed horizontal rule style (#218, #219)

### Fixed

- Fixed `Element::getValue()` not handling possible nulls

## [5.0.2] - 2021-11-06

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getTagName(): string

public function getValue(): string
{
return $this->node->nodeValue;
return $this->node->nodeValue ?? '';
}

public function hasParent(): bool
Expand Down

0 comments on commit b5eebae

Please sign in to comment.