mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-17 07:57:37 +08:00
fix: use ancestry slice for warning log, not meta.Parents
ancestry grows to len(meta.Parents)+1. The subsequent warning log indexed meta.Parents[len(ancestry)-1], which is one past the end of meta.Parents, causing an out-of-bounds panic. Use ancestry[len(ancestry)-1] to always reference the last element of the actual slice being validated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
566fd74efe
commit
5b87945f23
@ -72,7 +72,7 @@ func ResolvePage(
|
|||||||
log.Warningf(
|
log.Warningf(
|
||||||
nil,
|
nil,
|
||||||
"page %q is not found ",
|
"page %q is not found ",
|
||||||
meta.Parents[len(ancestry)-1],
|
ancestry[len(ancestry)-1],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user