Index: cache.php
===================================================================
--- cache.php	(revision 15324)
+++ cache.php	(working copy)
@@ -23,8 +23,11 @@
  */
 function wp_cache_add($key, $data, $flag = '', $expire = 0) {
 	global $wp_object_cache;
-
-	return $wp_object_cache->add($key, $data, $flag, $expire);
+	
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'add' ) )
+		return $wp_object_cache->add($key, $data, $flag, $expire);
+		
+	return false;
 }
 
 /**
@@ -56,8 +59,11 @@
  */
 function wp_cache_delete($id, $flag = '') {
 	global $wp_object_cache;
-
-	return $wp_object_cache->delete($id, $flag);
+	
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'delete' ) )
+		return $wp_object_cache->delete($id, $flag);
+		
+	return false;
 }
 
 /**
@@ -67,12 +73,15 @@
  * @uses $wp_object_cache Object Cache Class
  * @see WP_Object_Cache::flush()
  *
- * @return bool Always returns true
+ * @return bool Returns true on success, false if cache doesn't exist
  */
 function wp_cache_flush() {
 	global $wp_object_cache;
-
-	return $wp_object_cache->flush();
+	
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'flush' ) )
+		return $wp_object_cache->flush();
+		
+	return false;
 }
 
 /**
@@ -89,8 +98,11 @@
  */
 function wp_cache_get($id, $flag = '') {
 	global $wp_object_cache;
-
-	return $wp_object_cache->get($id, $flag);
+	
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'get' ) )
+		return $wp_object_cache->get($id, $flag);
+		
+	return false;
 }
 
 /**
@@ -119,7 +131,10 @@
 function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
 	global $wp_object_cache;
 
-	return $wp_object_cache->replace($key, $data, $flag, $expire);
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'replace' ) )
+		return $wp_object_cache->replace($key, $data, $flag, $expire);
+		
+	return false;
 }
 
 /**
@@ -138,7 +153,10 @@
 function wp_cache_set($key, $data, $flag = '', $expire = 0) {
 	global $wp_object_cache;
 
-	return $wp_object_cache->set($key, $data, $flag, $expire);
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'set' ) )
+		return $wp_object_cache->set($key, $data, $flag, $expire);
+		
+	return false;
 }
 
 /**
@@ -151,7 +169,10 @@
 function wp_cache_add_global_groups( $groups ) {
 	global $wp_object_cache;
 
-	return $wp_object_cache->add_global_groups($groups);
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'add_global_groups' ) )
+		return $wp_object_cache->add_global_groups($groups);
+		
+	return false;
 }
 
 /**
@@ -177,7 +198,10 @@
 function wp_cache_reset() {
 	global $wp_object_cache;
 
-	return $wp_object_cache->reset();
+	if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'reset' ) )
+		return $wp_object_cache->reset();
+		
+	return false;
 }
 
 /**
