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

Fix null reference in toggle entry attachments shortcut #1723

Closed
wants to merge 1 commit into from

Conversation

sigsignv
Copy link
Contributor


document.querySelector() possibly return null.

If entry has not attachment, return value is null. null.toggleAttribute('open') cause TypeError.

Optional chaining operator can fix it, supported by most modern browsers:

  • Chrome: 80+ (2020-)
  • Saferi: 13.4+ (2020-)
  • Firefox: 74+ (2020-)

@sigsignv
Copy link
Contributor Author

Sorry. I overlooked jshintrc.

@fguillot
Copy link
Member

Using a if statement instead of an optional chaining operator should be pretty straightforward.

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

Successfully merging this pull request may close these issues.

2 participants