Skip to content

Commit

Permalink
Update LinkedList.php
Browse files Browse the repository at this point in the history
Fix to small detected bug.
  • Loading branch information
usernane committed Mar 28, 2021
1 parent 96ba237 commit ac072ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LinkedList.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public function max() {
* @since 1.4.3
*/
public function next() {
$this->iteratorEl = $this->iteratorEl->next();
$this->iteratorEl = $this->iteratorEl !== null ? $this->iteratorEl->next() : null;

if ($this->iteratorEl !== null) {
return $this->iteratorEl->data();
Expand Down

0 comments on commit ac072ab

Please sign in to comment.