File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -135,27 +135,29 @@ func isIconValid(name string) error {
135135 return err
136136 }
137137
138- if server .Image == "" {
139- return fmt .Errorf ("image is not valid. It must be a valid image" )
138+ if server .About .Icon == "" {
139+ fmt .Println ("🛑 No icon found" )
140+ return nil
140141 }
141142 // fetch the image and check the size
142143 resp , err := http .Get (server .About .Icon )
143144 if err != nil {
144- return err
145+ fmt .Println ("🛑 Icon could not be fetched" )
146+ return nil
145147 }
146148 defer resp .Body .Close ()
147149 if resp .StatusCode != 200 {
148- return fmt .Errorf ("image is not valid. It must be a valid image" )
150+ return fmt .Errorf ("icon is not valid. It must be a valid image" )
149151 }
150152 if resp .ContentLength > 2 * 1024 * 1024 {
151- return fmt .Errorf ("image is too large. It must be less than 2MB" )
153+ return fmt .Errorf ("icon is too large. It must be less than 2MB" )
152154 }
153155 img , format , err := image .DecodeConfig (resp .Body )
154156 if err != nil {
155157 return err
156158 }
157159 if format != "png" {
158- return fmt .Errorf ("image is not a png. It must be a png" )
160+ return fmt .Errorf ("icon is not a png. It must be a png" )
159161 }
160162
161163 if img .Width > 512 || img .Height > 512 {
You can’t perform that action at this time.
0 commit comments