From: daiwei Date: Thu, 4 Dec 2025 02:43:21 +0000 (+0800) Subject: fix(KeepAlive): correct condition for caching inner blocks to handle null cases X-Git-Tag: v3.6.0-alpha.6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71e2495e468d21b37d7b57c3013be9da3ce59c5b;p=thirdparty%2Fvuejs%2Fcore.git fix(KeepAlive): correct condition for caching inner blocks to handle null cases --- diff --git a/packages/runtime-vapor/src/components/KeepAlive.ts b/packages/runtime-vapor/src/components/KeepAlive.ts index 2e285e6ab3..cc5df7baef 100644 --- a/packages/runtime-vapor/src/components/KeepAlive.ts +++ b/packages/runtime-vapor/src/components/KeepAlive.ts @@ -126,7 +126,7 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({ const processFragment = (frag: DynamicFragment) => { const [innerBlock, interop] = getInnerBlock(frag.nodes) - if (!innerBlock && !shouldCache(innerBlock!, props, interop)) return + if (!innerBlock || !shouldCache(innerBlock!, props, interop)) return if (interop) { if (cache.has(innerBlock.vnode!.type)) {