diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:48:59 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:48:59 +0000 |
commit | 1a36d4fec45242dd3443dd2ced489a593c0cac88 (patch) | |
tree | f00d6c39050908ec8fc8e7c27c641c510f7f1e35 /core | |
parent | 4b006a0419bfb19b75728caf7f50b1a8b1ef4419 (diff) |
parent() should return null if there's no parent id
Diffstat (limited to 'core')
-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); } |