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

Don't rely on truthiness #163

Merged
merged 1 commit into from
Jan 28, 2018
Merged

Don't rely on truthiness #163

merged 1 commit into from
Jan 28, 2018

Conversation

niik
Copy link
Member

@niik niik commented Jan 24, 2018

I ran into this today while needing to shell out to a git command with an empty stdin (but I still needed there to be an open and subsequent close of stdin).

The truthiness check for options.stdin fails for empty strings as yabbascript thinks that's equalish to false. This change makes it so that only when the user omits to pass a value for stdin do we skip closing stdin.

I ran into this today while needing to shell out to a git command with an empty stdin (but I still needed there to be an open and subsequent close of stdin).

The truthiness check for `options.stdin` fails for empty strings as yabbascript thinks that's equalish to false. This change makes it so that only when the user omits to pass a value for stdin do we skip closing stdin.
@@ -224,7 +224,7 @@ export class GitProcess {
}
})

if (options && options.stdin) {
if (options && options.stdin !== undefined) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@shiftkey shiftkey merged commit 7ead9de into master Jan 28, 2018
@shiftkey shiftkey deleted the truthyfruity branch January 28, 2018 06:39
@shiftkey
Copy link
Member

Nice find @niik. I've published v1.57.0 to NPM and I'll get this into Desktop 🔜

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.

3 participants