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 {
135
135
return err
136
136
}
137
137
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
140
141
}
141
142
// fetch the image and check the size
142
143
resp , err := http .Get (server .About .Icon )
143
144
if err != nil {
144
- return err
145
+ fmt .Println ("🛑 Icon could not be fetched" )
146
+ return nil
145
147
}
146
148
defer resp .Body .Close ()
147
149
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" )
149
151
}
150
152
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" )
152
154
}
153
155
img , format , err := image .DecodeConfig (resp .Body )
154
156
if err != nil {
155
157
return err
156
158
}
157
159
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" )
159
161
}
160
162
161
163
if img .Width > 512 || img .Height > 512 {
You can’t perform that action at this time.
0 commit comments