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: Check for widths array length so empty arrays are never used #351

Merged
merged 2 commits into from
Sep 20, 2019

Conversation

Robdel12
Copy link
Contributor

What is this?

If you pass an empty array from and SDK, the asset discovery service blows up. We should just fall back to the default widths

If you pass an empty array from and SDK, the asset discovery service blows up. We should just fall back to the default widths
@@ -96,9 +96,10 @@ export class AgentService {
const configuration = new ConfigurationService().configuration
// trim the string of whitespace and concat per-snapshot CSS with the globally specified CSS
const percySpecificCSS = configuration.snapshot['percy-css'].concat(request.body.percyCSS || '').trim()
const hasWidths = !!request.body.widths && request.body.widths.length
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's real annoying that !![] is true in JS

@Robdel12 Robdel12 merged commit e044749 into master Sep 20, 2019
@Robdel12 Robdel12 deleted the rd/check-for-empty-widths branch September 20, 2019 18:56
djones pushed a commit that referenced this pull request Sep 20, 2019
## [0.15.1](v0.15.0...v0.15.1) (2019-09-20)

### Bug Fixes

* Check for widths array length so empty arrays are never used ([#351](#351)) ([e044749](e044749))
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

Successfully merging this pull request may close these issues.

None yet

2 participants