Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix(emoji): hopefully guard against the crash in #3331

Gabe Kangaseeaa85dacbbf
diff --git a/core/data/emoji.go b/core/data/emoji.go
index 6b67cd76f7..86ea61d501 100644
--- a/core/data/emoji.go
+++ b/core/data/emoji.go
@@ -45,12 +45,16 @@ func UpdateEmojiList(force bool) (time.Time, error) {
if force {
emojiCacheModTime = time.Now()
}
+
emojiFS := os.DirFS(config.CustomEmojiPath)
+ if emojiFS == nil {
+ return modTime, fmt.Errorf("unable to open custom emoji directory")
+ }
emojiCacheData = make([]models.CustomEmoji, 0)
walkFunction := func(path string, d os.DirEntry, err error) error {
- if d.IsDir() {
+ if d == nil || d.IsDir() {
return nil
}