fix crash when XOpenIM returns NULL

No match.