From: Aryeh Gregor Date: Tue, 18 Aug 2009 20:14:41 +0000 (+0000) Subject: Throw an exception instead of PHP fatal error X-Git-Tag: 1.31.0-rc.0~40239 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=0b29e17e8db8387a091677d50503ac383f525ad5;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/Title.php b/includes/Title.php index bf02a6f359..e6ff7a6e8a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 );