Skip to content

Commit

Permalink
Merge pull request #68 from hackbac/hackbac/issue-54
Browse files Browse the repository at this point in the history
[Issue #54] Fix NilClass evaluation
  • Loading branch information
yatish27 authored Jul 13, 2017
2 parents 7423050 + d9ef244 commit 3ff3f41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/salesforce_bulk_api/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ def get_job_result(return_result, timeout)
state = []
Timeout::timeout(timeout, SalesforceBulkApi::JobTimeout) do
while true
if self.check_job_status['state'][0] == 'Closed'
job_status = self.check_job_status
if job_status && job_status['state'] && job_status['state'][0] == 'Closed'
batch_statuses = {}

batches_ready = @batch_ids.all? do |batch_id|
batch_state = batch_statuses[batch_id] = self.check_batch_status(batch_id)
batch_state['state'][0] != "Queued" && batch_state['state'][0] != "InProgress"
batch_state && batch_state['state'] && batch_state['state'][0] && !['Queued', 'InProgress'].include?(batch_state['state'][0])
end

if batches_ready
Expand Down

0 comments on commit 3ff3f41

Please sign in to comment.