summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/spritecache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 83c6a15ae..75e402bed 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -885,7 +885,7 @@ void GfxClearSpriteCache()
/* Clear sprite ptr for all cached items */
for (uint i = 0; i != _spritecache_items; i++) {
SpriteCache *sc = GetSpriteCache(i);
- if (sc->type != ST_RECOLOUR) DeleteEntryFromSpriteCache(i);
+ if (sc->type != ST_RECOLOUR && sc->ptr != NULL) DeleteEntryFromSpriteCache(i);
}
}