- component[:script_parameters].each do |pname, val|
- if val.is_a? Hash and val[:dataclass]
- # this is user-inputtable, so check the value from the source pipeline
- srcvalue = source.components[cname][:script_parameters][pname]
- if not srcvalue.nil?
- component[:script_parameters][pname] = srcvalue
+ # Skip any components that are not present in the
+ # source instance (there's nothing to copy)
+ if source.components.include? cname
+ component[:script_parameters].each do |pname, val|
+ if val.is_a? Hash and val[:dataclass]
+ # this is user-inputtable, so check the value from the source pipeline
+ srcvalue = source.components[cname][:script_parameters][pname]
+ if not srcvalue.nil?
+ component[:script_parameters][pname] = srcvalue
+ end