Merge "Handle failure to load content in Revision getSize, etc"
[lhc/web/wiklou.git] / includes / Revision.php
index 6db3710..66b4173 100644 (file)
@@ -1072,7 +1072,11 @@ class Revision implements IDBAccessObject {
 
                $comment = CommentStoreComment::newUnsavedComment( $summary, null );
 
-               $title = Title::newFromID( $pageId );
+               $title = Title::newFromID( $pageId, Title::GAID_FOR_UPDATE );
+               if ( $title === null ) {
+                       return null;
+               }
+
                $rec = self::getRevisionStore()->newNullRevision( $dbw, $title, $comment, $minor, $user );
 
                return new Revision( $rec );