diff --git a/src/spritecache.cpp b/src/spritecache.cpp index 964bcc71380..b08231aaf10 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -125,6 +125,9 @@ struct SpriteCache { void RemoveByMissingZoomLevels(uint8 lvls) { Sprite *base = this->GetSpritePtr(); + if (base == nullptr) { + return; + } if (base->missing_zoom_levels == lvls) { /* erase top level entry */ this->ptr.reset(base->next);