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

add ? to potential null string #16

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

ashishkeshan
Copy link
Contributor

Make sure the string is not NULL before doing the toString()

@ashishkeshan ashishkeshan requested a review from a team as a code owner March 27, 2024 19:40
@@ -64,7 +64,7 @@ function run() {
}

startTime = new Date()
output = execSync(command, {timeout, env, stdio: 'inherit'}).toString()
output = execSync(command, {timeout, env, stdio: 'inherit'})?.toString()

Choose a reason for hiding this comment

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

Is this like &. in ruby where it will only continue down the chain if there's a return value of the first part? I did some googling and it looks like that's what's happening here. If so, that's super cool. I didn't realize JS had this operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is!

@ashishkeshan ashishkeshan merged commit 4993a16 into main Mar 27, 2024
1 check passed
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.

2 participants