Oops, don't crash when an item has no previews

A weird state to get into, one would expect impossible! But something
funny is going on with the Kiko Lake Team Popcorn item (85598)!
This commit is contained in:
Emi Matchu 2024-09-27 14:14:28 -07:00
parent e7148ffae3
commit a08fb89d59

View file

@ -215,7 +215,8 @@ class ItemsController < ApplicationController
@item.compatible_pet_types.
preferring_species(cookies["preferred-preview-species-id"] || "<ignore>").
preferring_color(cookies["preferred-preview-color-id"] || "<ignore>").
preferring_simple.first
preferring_simple.first ||
PetType.matching_name("Blue", "Acara").first!
end
def validate_preview