handle the case where the ibus address can't be found. (prevents nasty crash)
authorEdward Rudd <urkle@outoforder.cc>
Wed, 01 Apr 2015 16:11:37 -0400
changeset 9451 28c55cb65416
parent 9450 bcb16ffce95b
child 9452 d16ad6375b01
handle the case where the ibus address can't be found. (prevents nasty crash)
src/core/linux/SDL_ibus.c
--- a/src/core/linux/SDL_ibus.c	Wed Apr 01 14:45:09 2015 -0400
+++ b/src/core/linux/SDL_ibus.c	Wed Apr 01 16:11:37 2015 -0400
@@ -462,6 +462,9 @@
         ibus_addr_file = SDL_strdup(addr_file);
         
         addr = IBus_ReadAddressFromFile(addr_file);
+        if (!addr) {
+            return SDL_FALSE;
+        }
         
         if (inotify_fd < 0) {
             inotify_fd = inotify_init();