summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-15 17:08:29 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-15 17:08:29 +0000
commit19149986c1cdc53b549d46000ba1ecd5eba317f6 (patch)
tree0b5a00ac841998ef818abe059fed60c763a8fd47
parent75cf17d0d66af81ef9f2c0d742114ffa27c31861 (diff)
Only cache rows if they are objects, which assumes also that they are instances of ORM.
-rw-r--r--core/libraries/MY_ORM.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/libraries/MY_ORM.php b/core/libraries/MY_ORM.php
index cc359799..fb2f80a7 100644
--- a/core/libraries/MY_ORM.php
+++ b/core/libraries/MY_ORM.php
@@ -38,7 +38,9 @@ class ORM_Iterator extends ORM_Iterator_Core {
*/
public function current() {
$row = parent::current();
- model_cache::set($row);
+ if (is_object($row)) {
+ model_cache::set($row);
+ }
return $row;
}
} \ No newline at end of file