diff options
-rw-r--r-- | core/libraries/ORM_MPTT.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php index 265cb8fb..f64ec200 100644 --- a/core/libraries/ORM_MPTT.php +++ b/core/libraries/ORM_MPTT.php @@ -117,6 +117,9 @@ class ORM_MPTT_Core extends ORM { * @return ORM */ function parent() { + if (!$this->parent_id) { + return null; + } return model_cache::get($this->model_name, $this->parent_id); } |