Fix handling of pipeline components with no job/output yet.
[arvados.git] / apps / workbench / app / controllers / pipeline_instances_controller.rb
index 4798271109a24fa6667b520739cf2934c048ed72..49f2a80e9ddf76dc6824544e77b91752ce8b1068 100644 (file)
@@ -13,7 +13,7 @@ class PipelineInstancesController < ApplicationController
       collections = []
 
       p.components.each do |k, v|
-        j = v[:job]
+        j = v[:job] || next
 
         uuid = j[:uuid].intern
         provenance[uuid] = j
@@ -31,7 +31,7 @@ class PipelineInstancesController < ApplicationController
         pips[uuid] |= n
       end
 
-      Collection.where(uuid: collections).each do |c|
+      Collection.where(uuid: collections.compact).each do |c|
         uuid = c.uuid.intern
         provenance[uuid] = c
         pips[uuid] = 0 unless pips[uuid] != nil