X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/8eed910da111b888ec363493ee55c6057eb61acf..7718480a6681242f7a78090d9f1eaf5f0c2fa615:/unix/uxsel.c diff --git a/unix/uxsel.c b/unix/uxsel.c index 7142acb2..0383faa6 100644 --- a/unix/uxsel.c +++ b/unix/uxsel.c @@ -115,6 +115,13 @@ int first_fd(int *state, int *rwx) int select_result(int fd, int event) { struct fd *fdstruct = find234(fds, &fd, uxsel_fd_findcmp); - assert(fdstruct != NULL); - return fdstruct->callback(fd, event); + /* + * Apparently this can sometimes be NULL. Can't see how, but I + * assume it means I need to ignore the event since it's on an + * fd I've stopped being interested in. Sigh. + */ + if (fdstruct) + return fdstruct->callback(fd, event); + else + return 1; }