fix: nil pointer dereference if cache is nil (#12215)

This commit is contained in:
Michael Yang
2025-09-08 09:53:59 -07:00
committed by GitHub
parent 4378ae4ffa
commit 9714e38dd0

View File

@@ -70,11 +70,9 @@ func kvCacheTypeFromStr(s string) ml.DType {
}
func (c *InputCache) Close() {
if c == nil {
return
if c != nil && c.cache != nil {
c.cache.Close()
}
c.cache.Close()
}
// Locking: Operations on InputCacheSlot (including finding one