Skip to content

Commit

Permalink
Do not print the bill addr. name when there's none
Browse files Browse the repository at this point in the history
The error

```
ActionView::Template::Error: undefined method `full_name' for nil:NilClass
```

happens a few times a day and raises exceptions we don't pay attention to.
They add unnecessary noise that hides other more relevant issues.

This, however, is a symptom of a deeper data integrity problem that needs
solving at some point. This is just a countermeasure.
  • Loading branch information
sauloperez committed Jun 30, 2020
1 parent e2e3ae6 commit 2317876
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/views/spree/admin/orders/invoice.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@
%td{ align: "left" }
%strong= "#{t('.to')}:"
%br
= @order.bill_address.full_name
- if @order.bill_address
= @order.bill_address.full_name
- if @order.andand.customer.andand.code.present?
%br
= "#{t('.code')}: #{@order.customer.code}"
%br
= @order.bill_address.full_address
- if @order.bill_address
= @order.bill_address.full_address
%br
- if @order.andand.customer.andand.email.present?
= "#{@order.customer.email},"
= "#{@order.bill_address.phone}"
- if @order.bill_address
= "#{@order.bill_address.phone}"
%td
 
%td{ align: "left", style: "border-left: .1em solid black; padding-left: 1em" }
Expand Down

0 comments on commit 2317876

Please sign in to comment.