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 invalid path join #436 #437

Merged
merged 1 commit into from
Mar 25, 2018
Merged

fix invalid path join #436 #437

merged 1 commit into from
Mar 25, 2018

Conversation

dreisel
Copy link
Contributor

@dreisel dreisel commented Mar 22, 2018

pathWithSymbols may be undefined and then an exception is thrown from the path.join method.
bug details: #436

@ob-stripe
Copy link
Contributor

@Reisel Thanks for the fix, however we cannot use it as-is as the default parameter syntax was only enabled by default in Node v6 [1], and the library still needs to support v4.

Can you change the fix to do something like var pathWithSymbols = typeof pathWithSymbols !== 'undefined' ? pathWithSymbols : '';?

[1] https://node.green/#ES2015-syntax-default-function-parameters

@dreisel
Copy link
Contributor Author

dreisel commented Mar 22, 2018

@ob-stripe how about

createResourcePathWithSymbols: function(pathWithSymbols) {
    return '/' + path.join(
      this.resourcePath,
      pathWithSymbols || ''
    ).replace(/\\/g, '/'); // ugly workaround for Windows
  }

@ob-stripe
Copy link
Contributor

Yeah, I think that'd be fine too :)

pathWithSymbols may be undefined and then an exception is thrown from the path.join method.
bug details: stripe#436
@dreisel
Copy link
Contributor Author

dreisel commented Mar 22, 2018

@ob-stripe updated.

Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

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

👍

@ob-stripe ob-stripe merged commit 52a896a into stripe:master Mar 25, 2018
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.

3 participants