Oops, don't crash calling current_nc_price
on non-NC-Mall items
If `nc_mall_record` is `nil`, return `nil`! (This is the nil method chaining operator!)
This commit is contained in:
parent
283a5b0479
commit
23ad52a8db
1 changed files with 1 additions and 1 deletions
|
@ -176,7 +176,7 @@ class Item < ApplicationRecord
|
|||
end
|
||||
|
||||
def current_nc_price
|
||||
nc_mall_record.current_price
|
||||
nc_mall_record&.current_price
|
||||
end
|
||||
|
||||
def restricted_zones(options={})
|
||||
|
|
Loading…
Reference in a new issue