From fe14dfe2ddec9302c01d6d3b3f6edf584c4585c4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 8 Feb 2010 18:06:16 -0500 Subject: [PATCH] fix crash in 3.4 that doesnt show up in work --- openbox/translate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbox/translate.c b/openbox/translate.c index bd8b88f6..71a919cb 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -166,7 +166,11 @@ gchar *translate_keycode(guint keycode) if ((sym = XKeycodeToKeysym(ob_display, keycode, 0)) != NoSymbol) ret = XKeysymToString(sym); - return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); + /* glib crashes in g_locale_to_utf8 if you pass it NULL here */ + if (ret) + return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); + else + return NULL; } gunichar translate_unichar(guint keycode) -- 2.34.1