Unverified Commit 9714e38d authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

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

parent 4378ae4f
...@@ -70,11 +70,9 @@ func kvCacheTypeFromStr(s string) ml.DType { ...@@ -70,11 +70,9 @@ func kvCacheTypeFromStr(s string) ml.DType {
} }
func (c *InputCache) Close() { func (c *InputCache) Close() {
if c == nil { if c != nil && c.cache != nil {
return
}
c.cache.Close() c.cache.Close()
}
} }
// Locking: Operations on InputCacheSlot (including finding one // Locking: Operations on InputCacheSlot (including finding one
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment