From: jeroendedauw Date: Wed, 2 May 2012 15:04:29 +0000 (+0200) Subject: add type check and bail out when title could not be created X-Git-Tag: 1.31.0-rc.0~23471^2~1 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=c4e407cf6cfb67dc748674c2c201c03de6bb89a4;p=lhc%2Fweb%2Fwiklou.git add type check and bail out when title could not be created Change-Id: I5d931892d8f8f70a3dc13d0ed73413de47d43f53 --- diff --git a/includes/job/JobQueue.php b/includes/job/JobQueue.php index ac70dcbd76..e436333f32 100644 --- a/includes/job/JobQueue.php +++ b/includes/job/JobQueue.php @@ -186,6 +186,11 @@ abstract class Job { $namespace = $row->job_namespace; $dbkey = $row->job_title; $title = Title::makeTitleSafe( $namespace, $dbkey ); + + if ( is_null( $title ) ) { + return false; + } + $job = Job::factory( $row->job_cmd, $title, Job::extractBlob( $row->job_params ), $row->job_id ); // Remove any duplicates it may have later in the queue @@ -204,7 +209,7 @@ abstract class Job { * @param $id Int: Job identifier * @return Job */ - static function factory( $command, $title, $params = false, $id = 0 ) { + static function factory( $command, Title $title, $params = false, $id = 0 ) { global $wgJobClasses; if( isset( $wgJobClasses[$command] ) ) { $class = $wgJobClasses[$command];