From 2818a6da1e1c4a66ce01fe06d12cffd996c40237 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 15 Mar 2014 17:53:42 -0500 Subject: Don't crash when fail to create SDL window --- src/sdl/sdl_glimp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sdl/sdl_glimp.c') diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index bfd8efa9..6c313cda 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -477,6 +477,12 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor SDL_FreeSurface( icon ); + if( !SDL_window ) + { + ri.Printf( PRINT_ALL, "Couldn't get a visual\n" ); + return RSERR_INVALID_MODE; + } + GLimp_DetectAvailableModes(); glstring = (char *) qglGetString (GL_RENDERER); -- cgit