Skip to content

Commit 71e2495

Browse files
committed
fix(KeepAlive): correct condition for caching inner blocks to handle null cases
1 parent 0dcc98f commit 71e2495

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-vapor/src/components/KeepAlive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
126126

127127
const processFragment = (frag: DynamicFragment) => {
128128
const [innerBlock, interop] = getInnerBlock(frag.nodes)
129-
if (!innerBlock && !shouldCache(innerBlock!, props, interop)) return
129+
if (!innerBlock || !shouldCache(innerBlock!, props, interop)) return
130130

131131
if (interop) {
132132
if (cache.has(innerBlock.vnode!.type)) {

0 commit comments

Comments
 (0)