diff --git a/dmenu.c b/dmenu.c index c2425e2..2c64545 100644 --- a/dmenu.c +++ b/dmenu.c @@ -698,8 +698,9 @@ setup(void) if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) die("XOpenIM failed: could not open input device"); - xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, win, XNFocusWindow, win, NULL); + if ((xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, + XNClientWindow, win, XNFocusWindow, win, NULL)) == NULL) + die("XCreateIC failed: could not obtain input context"); XMapRaised(dpy, win); if (embed) {