Avoid potential crash if Fl::focus() returns NULL.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10527 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy
2015-01-19 14:41:32 +00:00
parent 4e53b4f616
commit eb33a418d5
+2 -1
View File
@@ -2256,7 +2256,8 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
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 {