Skip to content

Commit 363158e

Browse files
committed
fix: Apply safe navigation when resolving optional belongs_to resource
1 parent 177fcef commit 363158e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/concerns/cable_ready/updatable/collections_registry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def find_resource_for_update(collection, model)
5252

5353
resource = model
5454
resource = resource.send(collection.through_association.underscore) if collection.through_association
55-
resource.send(collection.inverse_association.underscore)
55+
resource&.send(collection.inverse_association.underscore)
5656
end
5757
end
5858
end

0 commit comments

Comments
 (0)