Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Conversation

@labnol
Copy link
Contributor

@labnol labnol commented Jun 5, 2018

If the Property Store returns a null token, this will throw an exception.

If the Property Store returns a null token, this will throw an exception.
@erickoledadevrel
Copy link

Under what circumstances would the token be null at this point? Is it just a case where the PropertiesService returns null incorrectly?

@labnol
Copy link
Contributor Author

labnol commented Jun 5, 2018

I was checking the logs of my Twitter app that uses this library and there were quite a few errors that read - "Cannot read property public from null."

The returned token was null and the method is trying to read a property from a null value.

@erickoledadevrel
Copy link

Gotcha. I think in that case throwing the "Token mistmatch" error would actually be incorrect, since that's not the root of the problem. What about calling the validate_ method on the token after you fetch it? It will still throw an error in this case, but a more explicit one.

Are you setting a cache when you setup the service? That could help if the root cause is the PropertiesService is returning stale data.

@AdminAC
Copy link

AdminAC commented Jun 5, 2018 via email

@erickoledadevrel
Copy link

@AdminAC - To stop getting email you need to un-watch this repository. https://github.com/gsuitedevs/apps-script-oauth1/watchers

@erickoledadevrel
Copy link

Will merge this in, but concerned the underlying cause is still out there. Thanks for contributing!

@erickoledadevrel erickoledadevrel merged commit 4f213f0 into googleworkspace:master Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants