From a908fc58aa9166acfc0b0d65111195f09f3a48f9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 17 Oct 2012 11:38:19 -0700 Subject: [PATCH] [JobQueue] Added type-guard checks to JobQueueGroup::push(). Change-Id: If41820aab396697546361bc83ba6ce26d08311d8 --- includes/job/JobQueueGroup.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.20.1