From: Alexandre Emsenhuber Date: Sat, 10 Nov 2012 13:02:51 +0000 (+0100) Subject: Follow-up I551a90b0 (c2172d4): add one more check for null content X-Git-Tag: 1.31.0-rc.0~21678 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=1f8652df6553265fe08a8daf2412dabbd40b3351;p=lhc%2Fweb%2Fwiklou.git Follow-up I551a90b0 (c2172d4): add one more check for null content Change-Id: Ifa26ea8df0c5dd1f4c6ecabb9c8020bb84401ea3 --- diff --git a/includes/Revision.php b/includes/Revision.php index df02b16db3..02eec315ed 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -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; } /**