From 1f8652df6553265fe08a8daf2412dabbd40b3351 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 10 Nov 2012 14:02:51 +0100 Subject: [PATCH] Follow-up I551a90b0 (c2172d4): add one more check for null content Change-Id: Ifa26ea8df0c5dd1f4c6ecabb9c8020bb84401ea3 --- includes/Revision.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } /** -- 2.20.1