fix nil issue
This commit is contained in:
parent
82bf407d05
commit
d878501070
@ -28,8 +28,12 @@ func (a *MapBlockAccessor) GetMapBlock(pos *coords.MapBlockCoords) (*mapblockpar
|
||||
cachedblock, found := a.blockcache.Get(key)
|
||||
if found {
|
||||
getCacheHitCount.Inc()
|
||||
if cachedblock == nil {
|
||||
return nil, nil
|
||||
} else {
|
||||
return cachedblock.(*mapblockparser.MapBlock), nil
|
||||
}
|
||||
}
|
||||
|
||||
timer := prometheus.NewTimer(dbGetDuration)
|
||||
defer timer.ObserveDuration()
|
||||
|
Loading…
Reference in New Issue
Block a user