segfault fix: ps->sfd can be null

fixes #48