Skip to content

(GitHub Toggle Issue Comments) "Cannot read property 'textContent' of null" in a specific PR page #56

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

Closed
darkred opened this issue Sep 21, 2018 · 2 comments

Comments

@darkred
Copy link
Collaborator

darkred commented Sep 21, 2018

Using Chrome 69, TM 4.8.5850 beta, GitHub Toggle Issue Comments in 1.2.2.

The issue is that, in the specific following PR page (I couldn't find any other pages to recreate)
https://github.com/sindresorhus/refined-github/pull/1526
the script's filters are non-toggleable and disabled, and I get the following error in Chrome's Console:

Execution of script 'GitHub Toggle Issue Comments' failed! Cannot read property 'textContent' of null

referring to line 404 of the script which contains:

txt = el.textContent.trim();
@Mottie
Copy link
Owner

Mottie commented Sep 22, 2018

Hi @darkred!

I can't reproduce the error you're mentioning, but I can fortify the code to prevent that error from popping up. Please check the updated userscript to see if it's been fixed.

@darkred
Copy link
Collaborator Author

darkred commented Sep 22, 2018

Hey @Mottie 🙂

The issue is reproducible as follows:
with a fresh Chrome browser profile with only TM 4.8.5850 beta and the script v1.2.2
load https://github.com/sindresorhus/refined-github/pull/1526 :
initially the script runs ok, i.e. the proper filters become bold,
but, when you click the +1 Comments filter to activate it,
you get the Uncaught TypeError: Cannot read property 'textContent' of null error in Console,
and then, if you reload the page, all filters are now non-toggleable and disabled.


Yes, with your new version it's now fixed. Thank you very much!

@darkred darkred closed this as completed Sep 22, 2018
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

No branches or pull requests

2 participants