From f6334bb3b89a604e36440065b36e0de6ac96207a Mon Sep 17 00:00:00 2001 From: Allen Torres Date: Thu, 1 Nov 2012 09:37:06 -0400 Subject: [PATCH] Added a check to see if we have args before we attempt to access the first item in the payload args to prevent an undefined index error. --- lib/Resque/Job.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Resque/Job.php b/lib/Resque/Job.php index e673c4f..0e03f04 100755 --- a/lib/Resque/Job.php +++ b/lib/Resque/Job.php @@ -230,8 +230,9 @@ class Resque_Job if($status->isTracking()) { $monitor = true; } - - return self::create($this->queue, $this->payload['class'], $this->payload['args'][0], $monitor); + $args = count($this->payload['args'])? $this->payload['args'][0] : $this->payload['args']; + + return self::create($this->queue, $this->payload['class'], $args, $monitor); } /**