changed bool checks to make sense

This commit is contained in:
Lasse Martin Jakobsen 2019-08-05 10:36:56 +02:00
parent 1aead7e4d1
commit 5272e93547

View file

@ -272,15 +272,18 @@ func GetItem(extension string) (Item, error) {
return EmptyItem, errors.New("reference not found in cache")
}
if ref, ok := refIface.(string); ok {
ref, ok := refIface.(string)
if !ok {
// return cast error on reference
}
if itemIface, ok := db.ItemCache.Get(ref); ok {
itemIface, ok := db.ItemCache.Get(ref)
if !ok {
// return no item found in cache by reference
}
if item, ok := itemIface.(Item); ok {
item, ok := itemIface.(Item)
if !ok {
// return cast error on item interface
}