Merge pull request #31 from Pungyeon/inverted_bool_checks

changed bool checks to make sense
This commit is contained in:
Lasse Martin Jakobsen 2019-08-05 18:33:28 +02:00 committed by GitHub
commit 061ee338a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}