Skip to content

Commit

Permalink
Fix InvoicesHelper#display_entity
Browse files Browse the repository at this point in the history
The invoice.entity might be nil, for example when a future membership has been deleted.

https://appsignal.com/csa-admin/sites/672e0b61d2a5e4b5197f10e4/exceptions/incidents/401/samples/timestamp/2025-01-28T17:05:27Z
  • Loading branch information
thibaudgg committed Jan 28, 2025
1 parent b0cdf13 commit 6595007
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/invoices_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def entity_type_collection
def display_entity(invoice, link: true)
if link && invoice.entity
auto_link invoice.entity
elsif invoice.entity_type == "Membership"
elsif invoice.entity.is_a?(Membership)
t("billing.membership_entity",
fiscal_year: invoice.entity.fiscal_year,
number: invoice.memberships_amount_description[/#\d+\z/])
Expand Down

0 comments on commit 6595007

Please sign in to comment.