From: Sean Colombo Date: Thu, 29 Sep 2011 23:11:31 +0000 (+0000) Subject: Revision::newFromTitle() returns null sometimes. Protect against the errors. X-Git-Tag: 1.31.0-rc.0~27349 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=629f800f51d0e492f25e115b0072caebf19aeb30;p=lhc%2Fweb%2Fwiklou.git Revision::newFromTitle() returns null sometimes. Protect against the errors. --- diff --git a/includes/Title.php b/includes/Title.php index b31b87eceb..4868761885 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3575,6 +3575,9 @@ class Title { } # Get the article text $rev = Revision::newFromTitle( $nt ); + if( !is_object( $rev ) ){ + return false; + } $text = $rev->getText(); # Does the redirect point to the source? # Or is it a broken self-redirect, usually caused by namespace collisions?