Skip to content

Commit d7a12f2

Browse files
committed
fix for 2 crashes
1 parent 10bb60f commit d7a12f2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/sdl/surface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ surface& surface::operator=(surface&& s) noexcept
9696

9797
surface surface::clone() const
9898
{
99+
if(!surface_) {
100+
return {};
101+
}
99102
// Use SDL_ConvertSurfaceFormat to make a copy
100103
return surface(SDL_ConvertSurface(surface_, SDL_PIXELFORMAT_ARGB8888));
101104
}

0 commit comments

Comments
 (0)