Merge "Avoid fatal in ContentHandler::getUndoContent by null content"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 Nov 2013 19:45:30 +0000 (19:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 Nov 2013 19:45:30 +0000 (19:45 +0000)
includes/content/ContentHandler.php

index 2a92e23..8991290 100644 (file)
@@ -907,6 +907,10 @@ abstract class ContentHandler {
                $undo_content = $undo->getContent();
                $undoafter_content = $undoafter->getContent();
 
+               if ( !$undo_content || !$undoafter_content ) {
+                       return false; // no content to undo
+               }
+
                $this->checkModelID( $cur_content->getModel() );
                $this->checkModelID( $undo_content->getModel() );
                $this->checkModelID( $undoafter_content->getModel() );