mscdex/node-imap — pull request #222 by dwatson (2013-05-31 10:34:54+00:00)
Title: Prevents "Cannot read property 'cmd' of undefined"

This is what I am using to prevent the crash when requests[0] is undefined, it of course does not fix the underlying issue but will at least prevent the process from exiting.