Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Allow fully empty variant image objects
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacia committed May 19, 2017
1 parent f252186 commit 588efee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/listings.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,9 @@ func validateListing(listing *pb.Listing) (err error) {
if len(variant.Name) > WordMaxCharacters {
return fmt.Errorf("Variant name length must be less than the max of %d", WordMaxCharacters)
}
if variant.Image != nil {
if variant.Image != nil && (variant.Image.Filename != "" ||
variant.Image.Large != "" || variant.Image.Medium != "" || variant.Image.Small != "" ||
variant.Image.Tiny != "" || variant.Image.Original != "") {
_, err := mh.FromB58String(variant.Image.Tiny)
if err != nil {
return errors.New("Tiny image hashes must be multihashes")
Expand Down

1 comment on commit 588efee

@drwasho
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bless you @cpacia

Please sign in to comment.