Explorar o código

:bug: 双击打开图片不对 Fix https://github.com/siyuan-note/siyuan/issues/5876

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
9fc80a5edd
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      kernel/model/assets.go

+ 3 - 0
kernel/model/assets.go

@@ -58,6 +58,9 @@ func DocImageAssets(rootID string) (ret []string, err error) {
 		if ast.NodeImage == n.Type {
 		if ast.NodeImage == n.Type {
 			linkDest := n.ChildByType(ast.NodeLinkDest)
 			linkDest := n.ChildByType(ast.NodeLinkDest)
 			dest := linkDest.Tokens
 			dest := linkDest.Tokens
+			if 1 > len(dest) { // 双击打开图片不对 https://github.com/siyuan-note/siyuan/issues/5876
+				return ast.WalkContinue
+			}
 			ret = append(ret, gulu.Str.FromBytes(dest))
 			ret = append(ret, gulu.Str.FromBytes(dest))
 		}
 		}
 		return ast.WalkContinue
 		return ast.WalkContinue