Skip to content

Commit d16d9d5

Browse files
committed
Fixed #81
1 parent 976569c commit d16d9d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/NodeTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,13 @@ public function siblings($dir = null)
309309
break;
310310
}
311311

312-
$query->where($this->getParentIdName(), '=', $this->getParentId());
312+
$parentId = $this->getParentId();
313+
314+
if (is_null($parentId)) {
315+
$query->whereNull($this->getParentId());
316+
} else {
317+
$query->where($this->getParentIdName(), '=', $parentId);
318+
}
313319

314320
return $query;
315321
}

0 commit comments

Comments
 (0)