Skip to content

Commit

Permalink
Avoid potential crash if Fl::focus() returns NULL.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10527 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Jan 19, 2015
1 parent 4e53b4f commit eb33a41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Fl_cocoa.mm
Expand Up @@ -2256,7 +2256,8 @@ - (void)keyDown:(NSEvent *)theEvent {
Fl::first_window(window);
cocoaKeyboardHandler(theEvent);
in_key_event = YES;
if (Fl::focus()->as_gl_window()) { // ignore text input methods for GL windows
Fl_Widget *f = Fl::focus();
if (f && f->as_gl_window()) { // ignore text input methods for GL windows
need_handle = YES;
[FLView prepareEtext:[theEvent characters]];
} else {
Expand Down

0 comments on commit eb33a41

Please sign in to comment.