summary refs log tree commit diff
path: root/src/tilemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tilemap.c')
-rw-r--r--src/tilemap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tilemap.c b/src/tilemap.c
index e7ee1d4..34e7c43 100644
--- a/src/tilemap.c
+++ b/src/tilemap.c
@@ -102,6 +102,9 @@ void tilemap_foreground(struct tilemap *tilemap, int x, int y, int w, int h) {
 }
 
 void tilemap_free(struct tilemap *tilemap) {
+	if (tilemap == NULL) {
+		return;
+	}
 	SDL_DestroyTexture(tilemap->tileset);
 	SDL_DestroyTexture(tilemap->wang_tileset);
 	free(tilemap->parallax);