File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -744,7 +744,7 @@ public function find(array $selector, bool $searchChildren = true) : array {
744744
745745 // match first-child
746746 case 'first-child ' :
747- $ children = $ this ->parent ->children ();
747+ $ children = !== null ? $ this ->parent ->children () : [] ;
748748 if (!isset ($ children [0 ]) || $ this !== $ children [0 ]) {
749749 $ match = false ;
750750 break 2 ;
@@ -753,7 +753,7 @@ public function find(array $selector, bool $searchChildren = true) : array {
753753
754754 // match last child
755755 case 'last-child ' :
756- $ children = $ this ->parent -> children ();
756+ $ children = $ this ->parent !== null ? $ this -> parent -> children () : [] ;
757757 if (($ last = \end ($ children )) === false || $ this !== $ last ) {
758758 $ match = false ;
759759 break 2 ;
You can’t perform that action at this time.
0 commit comments