mod/core/set/all/trash.rb in card-1.93.3 vs mod/core/set/all/trash.rb in card-1.93.4
- old
+ new
@@ -97,9 +97,13 @@
end
event :validate_delete_children, after: :validate_delete, on: :delete do
return if errors.any?
children.each do |child|
+ next unless child
+ # prevents errors in cases where a child is deleted prior to this point
+ # and thus is not returned by the fetch in #children
+
child.trash = true
add_subcard child
# next if child.valid?
# child.errors.each do |field, message|
# errors.add field, "can't delete #{child.name}: #{message}"