summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-06 16:34:18 -1000
committerEvan Prodromou <evan@status.net>2010-01-06 16:34:18 -1000
commite50410683fa29dd424f893dd302d835828e0711f (patch)
tree1f65554c9cfbc611fe5b0309ae709add5e42f436 /classes
parent35d4587172955950957e017101c660976cfe68f9 (diff)
only encache new objects when insert was successful
Diffstat (limited to 'classes')
-rw-r--r--classes/Memcached_DataObject.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index d11bd6368..15ca34821 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -143,7 +143,9 @@ class Memcached_DataObject extends DB_DataObject
function insert()
{
$result = parent::insert();
- $this->encache(); // in case of cached negative lookups
+ if ($result) {
+ $this->encache(); // in case of cached negative lookups
+ }
return $result;
}