OSDN Git Service

fix nil asset display
authoroysheng <oysheng@bytom.io>
Thu, 19 Apr 2018 03:06:03 +0000 (11:06 +0800)
committeroysheng <oysheng@bytom.io>
Thu, 19 Apr 2018 03:06:03 +0000 (11:06 +0800)
asset/asset.go

index cd370b8..053d61a 100644 (file)
@@ -301,8 +301,10 @@ func (reg *Registry) GetAsset(id string) (*Asset, error) {
                if err := json.Unmarshal(extAsset, asset); err != nil {
                        return nil, err
                }
+               return asset, nil
        }
-       return asset, nil
+
+       return nil, errors.WithDetailf(ErrFindAsset, "no such asset, assetID: %s", id)
 }
 
 // ListAssets returns the accounts in the db