XGetWindowProperty() can report success but still give you a NULL pointer.
authorRyan C. Gordon
Sat, 22 Oct 2011 02:13:35 -0400
changeset 60236279958d571d
parent 6022 e0327dd7d0c0
child 6024 38e2f4644548
XGetWindowProperty() can report success but still give you a NULL pointer.

Thanks to Joseph Toppi for the fix!
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Mon Oct 24 11:38:52 2011 -0400
     1.2 +++ b/src/video/x11/SDL_x11window.c	Sat Oct 22 02:13:35 2011 -0400
     1.3 @@ -593,14 +593,14 @@
     1.4      status = XGetWindowProperty(display, xwindow, data->_NET_WM_NAME,
     1.5                  0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format,
     1.6                  &items_read, &items_left, &propdata);
     1.7 -    if (status == Success) {
     1.8 +    if (status == Success && propdata) {
     1.9          title = SDL_strdup(SDL_static_cast(char*, propdata));
    1.10          XFree(propdata);
    1.11      } else {
    1.12          status = XGetWindowProperty(display, xwindow, XA_WM_NAME,
    1.13                      0L, 8192L, False, XA_STRING, &real_type, &real_format,
    1.14                      &items_read, &items_left, &propdata);
    1.15 -        if (status == Success) {
    1.16 +        if (status == Success && propdata) {
    1.17              title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1);
    1.18          } else {
    1.19              title = SDL_strdup("");