소스 검색

cocoa: Don't crash on messagebox keypress without a successful SDL_Init().

Ryan C. Gordon 8 년 전
부모
커밋
ce2998b8b9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/video/cocoa/SDL_cocoakeyboard.m

+ 1 - 1
src/video/cocoa/SDL_cocoakeyboard.m

@@ -646,7 +646,7 @@ Cocoa_SetTextInputRect(_THIS, SDL_Rect *rect)
 void
 Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
 {
-    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
+    SDL_VideoData *data = _this ? ((SDL_VideoData *) _this->driverdata) : NULL;
     if (!data) {
         return;  /* can happen when returning from fullscreen Space on shutdown */
     }