src/video/x11/SDL_x11events.c
changeset 2323 4ac07ae446d3
parent 2306 1a8bab15a45d
child 2324 3202e4826c57
     1.1 --- a/src/video/x11/SDL_x11events.c	Thu Mar 06 17:08:10 2008 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Thu Mar 06 23:07:02 2008 +0000
     1.3 @@ -51,10 +51,15 @@
     1.4      }
     1.5  
     1.6      data = NULL;
     1.7 -    for (i = 0; i < videodata->numwindows; ++i) {
     1.8 -        if (videodata->windowlist[i]->window == xevent.xany.window) {
     1.9 -            data = videodata->windowlist[i];
    1.10 +    if (videodata && 
    1.11 +        videodata->windowlist) {
    1.12 +      for (i = 0; i < videodata->numwindows; ++i) {
    1.13 +        if ((videodata->windowlist[i] != NULL) &&
    1.14 +            (videodata->windowlist[i]->window == xevent.xany.window)) {
    1.15 +          data = videodata->windowlist[i];
    1.16 +          break;
    1.17          }
    1.18 +      }
    1.19      }
    1.20      if (!data) {
    1.21          return;