mirror of
https://github.com/ollama/ollama.git
synced 2025-10-10 18:44:16 +02:00
fix: nil pointer dereference if cache is nil (#12215)
This commit is contained in:
@@ -70,12 +70,10 @@ 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
|
||||||
// through LoadCacheSlot) require a lock to be held that serializes
|
// through LoadCacheSlot) require a lock to be held that serializes
|
||||||
|
Reference in New Issue
Block a user