Skip to content

Commit

Permalink
Prevent any record from being mutated if external_id is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
aom committed Mar 8, 2019
1 parent c430b7f commit 68400c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/netsuite/actions/add_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def add_list(records, credentials = {})
if response.success?
response.body.map do |attr|
record = netsuite_records.find do |r|
r.external_id == attr[:@external_id]
r.external_id != nil &&
r.external_id == attr[:@external_id]
end
next if record.nil?

record.instance_variable_set('@internal_id', attr[:@internal_id])
end
Expand Down

0 comments on commit 68400c0

Please sign in to comment.