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(prefer-to-have-value): check that property exists before accessing #243

Merged
merged 2 commits into from
Dec 26, 2021

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Dec 26, 2021

What:

Fixes a crash caught by #229 in prefer-to-have-value

Why:

It assumes that property will always be defined on the queryNode node if callee.name isn't, which is not always the case.

How:

I've implemented a guard to ensure that the property exists before trying to access it's name.

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Dec 26, 2021

Codecov Report

Merging #243 (f1983c4) into main (e8cefd3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #243   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          560       561    +1     
  Branches       156       157    +1     
=========================================
+ Hits           560       561    +1     
Impacted Files Coverage Δ
src/assignment-ast.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8cefd3...f1983c4. Read the comment docs.

@benmonro benmonro merged commit 3f59068 into main Dec 26, 2021
@benmonro benmonro deleted the check-property-exists branch December 26, 2021 08:25
@github-actions
Copy link

🎉 This PR is included in version 3.9.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants