lib/node_mutation.rb in node_mutation-1.4.2 vs lib/node_mutation.rb in node_mutation-1.4.3
- old
+ new
@@ -232,10 +232,10 @@
conflict_actions = get_conflict_actions
if conflict_actions.size > 0 && NodeMutation.strategy == THROW_ERROR
raise ConflictActionError, "mutation actions are conflicted"
end
@actions.reverse_each do |action|
- source[action.start...action.end] = action.new_code
+ source[action.start...action.end] = action.new_code if action.new_code
end
NodeMutation::Result.new(
affected: true,
conflicted: !conflict_actions.empty?,
new_source: source