From ed75592979367b8b2e61d003022ea638af1177a1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 22 Sep 2023 16:56:19 +0100 Subject: [PATCH] Fix crash attempting to remove sprite zoom level from empty entry --- src/spritecache.cpp | 3 +++ 1 file changed, 3 insertions(+) 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);