Skip to content

Commit d4a050f

Browse files
committed
Early-return if SDL icon surface is null
1 parent 12c6869 commit d4a050f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

osu.Framework/Platform/SDL3/SDL3Window.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ private void setSDLIcon(Image<Rgba32> image)
467467
{
468468
var pixelFormat = SDL_GetPixelFormatForMasks(32, 0xff, 0xff00, 0xff0000, 0xff000000);
469469
surface = SDL3Extensions.LogErrorIfFailed(SDL_CreateSurfaceFrom(imageSize.Width, imageSize.Height, pixelFormat, new IntPtr(ptr), imageSize.Width * 4));
470+
if (surface == null)
471+
return;
470472
}
471473

472474
SDL_SetWindowIcon(SDLWindowHandle, surface).LogErrorIfFailed();

0 commit comments

Comments
 (0)