Commit 7a40584f authored by Matt Liggett's avatar Matt Liggett

Verify that the we get a non-nil subtree before consulting it.

Fixes #27919
parent d7a86686
...@@ -98,6 +98,9 @@ func (cache *TreeCache) setSubCache(key string, subCache *TreeCache, path ...str ...@@ -98,6 +98,9 @@ func (cache *TreeCache) setSubCache(key string, subCache *TreeCache, path ...str
func (cache *TreeCache) getEntry(key string, path ...string) (interface{}, bool) { func (cache *TreeCache) getEntry(key string, path ...string) (interface{}, bool) {
childNode := cache.getSubCache(path...) childNode := cache.getSubCache(path...)
if childNode == nil {
return nil, false
}
val, ok := childNode.Entries[key] val, ok := childNode.Entries[key]
return val, ok return val, ok
} }
......
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