mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 13:50:06 +03:00
fix(emoji): hopefully guard against the crash in #3331
This commit is contained in:
parent
b1c0e14161
commit
027f2544e3
1 changed files with 5 additions and 1 deletions
|
@ -45,12 +45,16 @@ func UpdateEmojiList(force bool) (time.Time, error) {
|
||||||
if force {
|
if force {
|
||||||
emojiCacheModTime = time.Now()
|
emojiCacheModTime = time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
emojiFS := os.DirFS(config.CustomEmojiPath)
|
emojiFS := os.DirFS(config.CustomEmojiPath)
|
||||||
|
if emojiFS == nil {
|
||||||
|
return modTime, fmt.Errorf("unable to open custom emoji directory")
|
||||||
|
}
|
||||||
|
|
||||||
emojiCacheData = make([]models.CustomEmoji, 0)
|
emojiCacheData = make([]models.CustomEmoji, 0)
|
||||||
|
|
||||||
walkFunction := func(path string, d os.DirEntry, err error) error {
|
walkFunction := func(path string, d os.DirEntry, err error) error {
|
||||||
if d.IsDir() {
|
if d == nil || d.IsDir() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue