don't embed emus that don't exist
This commit is contained in:
parent
9ba857823b
commit
a02faab3fe
4
fun.go
4
fun.go
|
@ -193,6 +193,10 @@ func herdofemus(noise string) []Emu {
|
||||||
var emus []Emu
|
var emus []Emu
|
||||||
for _, e := range m {
|
for _, e := range m {
|
||||||
fname := e[1 : len(e)-1]
|
fname := e[1 : len(e)-1]
|
||||||
|
_, err := os.Stat("emus/" + fname + ".png")
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
url := fmt.Sprintf("https://%s/emu/%s.png", serverName, fname)
|
url := fmt.Sprintf("https://%s/emu/%s.png", serverName, fname)
|
||||||
emus = append(emus, Emu{ID: url, Name: e})
|
emus = append(emus, Emu{ID: url, Name: e})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue