next when check key is nil, do not add it to pp
Signed-off-by: Wei Jihui weijihuiall@163.com --- lib/job.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index 6497f0f1..8a6d68a5 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -568,14 +568,14 @@ class Job init_program_options() for_each_in(@job, @referenced_programs.keys) do |_pk, h, p_n, p_args| k = hash_key_re_string(@job, p_n, @job['pp'].keys) - next if k.nil? - - unless @job[k].is_a?(Hash) + if k && !@job[k].is_a?(Hash) @job['pp'][k] = @job[k] next end options_hash = @referenced_programs[p_n] program_name = hash_key_re_string(h, p_n, @job['pp'].keys) + next if program_name.nil? + @job["pp"][program_name] = Hash.new() options_array = options_hash.keys options_array.each do |option|