Browse Source

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

pull/3383/head
Gabe Kangas 2 years ago
parent
commit
027f2544e3
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 6
      core/data/emoji.go

6
core/data/emoji.go

@ -45,12 +45,16 @@ func UpdateEmojiList(force bool) (time.Time, error) { @@ -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
}

Loading…
Cancel
Save