rosulek / gmail-tickler

Get emails out of your inbox until a specified date
MIT License
19 stars 5 forks source link

Fail gracefully for threads that don't have messages #12

Closed lehrblogger closed 7 years ago

lehrblogger commented 8 years ago

I occasionally get email notifications of errors in processThreads that say TypeError: Cannot read property "length" from null. (line 134, file "Code"). I haven't been able to figure out what's causing this, and there's nothing in the documentation about why getMessages would return null for a thread, but it's still better not to crash the entire script when it does happen, since that could delay/confuse the untickling of other threads.

(My personal script has a few extra lines of config, hence the slight mismatch in the line numbers.)

lehrblogger commented 8 years ago

Note to self, in case I want to investigate this in the future: I think I just reproduced it by replying to myself on a thread that already had a tickler label, causing it to move around between my archive and inbox while the script was running.

lehrblogger commented 7 years ago

Closing this since I haven't seen it with the new implementation from https://github.com/rosulek/gmail-tickler/issues/6, but will re-open if necessary.