Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

Conversation

lehrblogger
Copy link
Contributor

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.)

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](https://developers.google.com/apps-script/reference/gmail/gmail-thread#getMessages()) 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.
@lehrblogger
Copy link
Contributor Author

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
Copy link
Contributor Author

Closing this since I haven't seen it with the new implementation from #6, but will re-open if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants