Follow-up I551a90b0 (c2172d4): add one more check for null content
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 10 Nov 2012 13:02:51 +0000 (14:02 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 10 Nov 2012 13:02:51 +0000 (14:02 +0100)
Change-Id: Ifa26ea8df0c5dd1f4c6ecabb9c8020bb84401ea3

includes/Revision.php

index df02b16..02eec31 100644 (file)
@@ -985,7 +985,7 @@ class Revision implements IDBAccessObject {
         * Gets the content object for the revision
         *
         * @since 1.21
-        * @return Content
+        * @return Content|null
         */
        protected function getContentInternal() {
                if( is_null( $this->mContent ) ) {
@@ -1003,7 +1003,8 @@ class Revision implements IDBAccessObject {
                                : $handler->unserializeContent( $this->mText, $format );
                }
 
-               return $this->mContent->copy(); // NOTE: copy() will return $this for immutable content objects
+               // NOTE: copy() will return $this for immutable content objects
+               return $this->mContent ? $this->mContent->copy() : null;
        }
 
        /**