Throw an exception instead of PHP fatal error
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 18 Aug 2009 20:14:41 +0000 (20:14 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 18 Aug 2009 20:14:41 +0000 (20:14 +0000)
I don't actually know how this is getting hit, but it was in my testing,
although not reproducibly.

includes/Title.php

index bf02a6f..e6ff7a6 100644 (file)
@@ -2977,6 +2977,9 @@ class Title {
 
                # Save a null revision in the page's history notifying of the move
                $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
+               if ( !is_object( $nullRevision ) ) {
+                       throw new MWException( 'No valid null revision produced in ' . __METHOD__ );
+               }
                $nullRevId = $nullRevision->insertOn( $dbw );
                
                $article = new Article( $this );