From 0b29e17e8db8387a091677d50503ac383f525ad5 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 18 Aug 2009 20:14:41 +0000 Subject: [PATCH] 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. --- includes/Title.php | 3 +++ 1 file changed, 3 insertions(+) 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 ); -- 2.20.1