From: Aaron Schulz Date: Wed, 17 Oct 2012 18:38:19 +0000 (-0700) Subject: [JobQueue] Added type-guard checks to JobQueueGroup::push(). X-Git-Tag: 1.31.0-rc.0~21983 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=a908fc58aa9166acfc0b0d65111195f09f3a48f9;p=lhc%2Fweb%2Fwiklou.git [JobQueue] Added type-guard checks to JobQueueGroup::push(). Change-Id: If41820aab396697546361bc83ba6ce26d08311d8 --- diff --git a/includes/job/JobQueueGroup.php b/includes/job/JobQueueGroup.php index 7d01a29c53..2f9415297c 100644 --- a/includes/job/JobQueueGroup.php +++ b/includes/job/JobQueueGroup.php @@ -87,7 +87,11 @@ class JobQueueGroup { $jobsByType = array(); // (job type => list of jobs) foreach ( $jobs as $job ) { - $jobsByType[$job->getType()][] = $job; + if ( $job instanceof Job ) { + $jobsByType[$job->getType()][] = $job; + } else { + throw new MWException( "Attempted to push a non-Job object into a queue." ); + } } $ok = true;