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

Relation.canonical getter throws when href contains no path #1100

Open
Munter opened this issue Jul 20, 2020 · 1 comment
Open

Relation.canonical getter throws when href contains no path #1100

Munter opened this issue Jul 20, 2020 · 1 comment

Comments

@Munter
Copy link
Member

Munter commented Jul 20, 2020

Munter/netlify-plugin-hashfiles#114 shows that if a relation with just a domain in its href is checked for being canonical with the Relation.canonical getter, we can throw on attempting to call .startsWith on null at https://github.com/assetgraph/assetgraph/blob/master/lib/relations/Relation.js#L278

We should add a check to ensure that both hrefObj and canonicalRootObj have non-null path properties

@Munter
Copy link
Member Author

Munter commented Aug 2, 2020

I can't really figure out how to recreate the setup that caused this, so I'm reluctant to make a change to the code when it won't be covered by a test

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

1 participant