mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 Fix NPE https://ld246.com/article/1739550445065
This commit is contained in:
parent
c3bc804fce
commit
4374859e04
2 changed files with 12 additions and 5 deletions
|
|
@ -22,7 +22,6 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -166,7 +165,7 @@ func getEmojiConf(c *gin.Context) {
|
|||
items := []map[string]interface{}{}
|
||||
custom["items"] = items
|
||||
if gulu.File.IsDir(customConfDir) {
|
||||
model.CustomEmojis = sync.Map{}
|
||||
model.ClearCustomEmojis()
|
||||
customEmojis, err := os.ReadDir(customConfDir)
|
||||
if err != nil {
|
||||
logging.LogErrorf("read custom emojis failed: %s", err)
|
||||
|
|
@ -224,7 +223,7 @@ func addCustomEmoji(name string, items *[]map[string]interface{}) {
|
|||
*items = append(*items, emoji)
|
||||
|
||||
imgSrc := "/emojis/" + name
|
||||
model.CustomEmojis.Store(nameWithoutExt, imgSrc)
|
||||
model.AddCustomEmoji(nameWithoutExt, imgSrc)
|
||||
}
|
||||
|
||||
func checkUpdate(c *gin.Context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue