Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Hi @jjjkkkjjj! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
zurfyx
left a comment
There was a problem hiding this comment.
Thanks! Can you expand on the issue please? Either add some video on the description or file an issue?
| url = a.href; | ||
| urlTarget = a.target; | ||
| // domGetParent can return null | ||
| url = a?.href; |
There was a problem hiding this comment.
You can't use ?. besides the playground. You will have to do a explicit check
I fixed the bug:
TypeError: Cannot read property 'href' of null.This bug may be caused by
avariable that can benull. (domGetParentfunction can returnnull)That's why
avariable has no attributehref.I modified
a?.hrefanda?.targetusing?operator instead ofa.hrefanda.target.When the optional
?operator is used,avariable can beundefined. So, I modified next condition with!urlinstead ofurl === null || url === ''.