mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
prevents access to the history state if not set (#12436)
This commit is contained in:
parent
e64ec5f9df
commit
453ec6b12f
2 changed files with 6 additions and 1 deletions
5
.changeset/dirty-teachers-know.md
Normal file
5
.changeset/dirty-teachers-know.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes a potential null access in the clientside router
|
|
@ -636,7 +636,7 @@ if (inBrowser) {
|
||||||
'scroll',
|
'scroll',
|
||||||
() => {
|
() => {
|
||||||
if (intervalId !== undefined) return;
|
if (intervalId !== undefined) return;
|
||||||
(lastIndex = history.state.index), (lastY = scrollY), (lastX = scrollX);
|
(lastIndex = history.state?.index), (lastY = scrollY), (lastX = scrollX);
|
||||||
intervalId = window.setInterval(scrollInterval, 50);
|
intervalId = window.setInterval(scrollInterval, 50);
|
||||||
},
|
},
|
||||||
{ passive: true },
|
{ passive: true },
|
||||||
|
|
Loading…
Reference in a new issue