From 2e3220e2e90a7e258ba413a456b846f617a8464c Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 18 Jan 2026 09:43:06 +0800 Subject: [PATCH] :bug: Fix npe https://github.com/siyuan-note/siyuan/issues/16855 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/storage.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/api/storage.go b/kernel/api/storage.go index 4c20087f6..197348f17 100644 --- a/kernel/api/storage.go +++ b/kernel/api/storage.go @@ -251,6 +251,10 @@ func updateRecentDocViewTime(c *gin.Context) { return } + if nil == arg["rootID"] { + return + } + rootID := arg["rootID"].(string) err := model.UpdateRecentDocViewTime(rootID) if err != nil { @@ -269,6 +273,10 @@ func updateRecentDocOpenTime(c *gin.Context) { return } + if nil == arg["rootID"] { + return + } + rootID := arg["rootID"].(string) err := model.UpdateRecentDocOpenTime(rootID) if err != nil {