fix nil issue

This commit is contained in:
Thomas Rudin 2019-03-13 21:14:04 +01:00
parent 82bf407d05
commit d878501070

View File

@ -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()