r55264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55263‎ | r55264 | r55265 >
Date:20:14, 18 August 2009
Author:simetrical
Status:ok
Tags:
Comment:
Throw an exception instead of PHP fatal error

I don't actually know how this is getting hit, but it was in my testing,
although not reproducibly.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -2977,6 +2977,9 @@
29782978
29792979 # Save a null revision in the page's history notifying of the move
29802980 $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true );
 2981+ if ( !is_object( $nullRevision ) ) {
 2982+ throw new MWException( 'No valid null revision produced in ' . __METHOD__ );
 2983+ }
29812984 $nullRevId = $nullRevision->insertOn( $dbw );
29822985
29832986 $article = new Article( $this );

Status & tagging log