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:
Emi Matchu 2024-05-21 17:24:55 -07:00
parent 283a5b0479
commit 23ad52a8db

View file

@ -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={})