* src/ui/X11/event-Xt.c (x_to_emacs_keysym): make fure there is a
frame before dereferencing to get the XIC.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
int bufsiz = sizeof(buffer);
Status status;
#ifdef XIM_XLIB
- XIC xic = FRAME_X_XIC(x_any_window_to_frame
- (get_device_from_display(event->display),
- event->window));
+ XIC xic = NULL;
+ struct frame * f =
+ x_any_window_to_frame(get_device_from_display(event->display));
+ if (f)
+ xic = FRAME_X_XIC(f, event->window));
#endif /* XIM_XLIB */
#endif /* HAVE_XIM */