Skip to content

Commit

Permalink
fix(nbp): abort finalize action if no relationship exists
Browse files Browse the repository at this point in the history
When appending a return statement to a method call, either with `and` or `&&`,
the return won't happen if there is a tailing one-line if statement.

Part of XI-6523
  • Loading branch information
nenock committed Feb 4, 2025
1 parent 61311a4 commit 16ae249
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/users/nbp_wallet_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def relationship_status

def finalize
relationship = Enmeshed::Relationship.pending_for(@provider_uid)
abort_and_refresh(relationship) and return if relationship.blank?
return abort_and_refresh(relationship) if relationship.blank?

Check warning on line 41 in app/controllers/users/nbp_wallet_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/users/nbp_wallet_controller.rb#L40-L41

Added lines #L40 - L41 were not covered by tests

accept_and_create_user(relationship)
rescue Enmeshed::ConnectorError, Faraday::Error => e
Expand Down

0 comments on commit 16ae249

Please sign in to comment.