Skip to content

Commit

Permalink
fix(windows): Fix issue #1579 -- adds optional chaining (#1592 by @ja…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamonholmgren committed Jan 13, 2021
1 parent a4c96f4 commit bffafa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ module.exports = {
// -=-=-=- android -=-=-=-
const androidPath = process.env.ANDROID_HOME
const javaPath = which("java")
const javaVersionCmd = isWindows ? "java -version" : "java -version 2>&1"
const javaVersion = javaPath && (await run(javaVersionCmd)).match(/"(.*)"/).slice(-1)[0]
const javaVersionCmd = "java -version 2>&1"
const javaVersion = javaPath && (await run(javaVersionCmd))?.match(/"(.*)"/)?.slice(-1)[0]

info("")
info(colors.cyan("Android"))
Expand Down

0 comments on commit bffafa5

Please sign in to comment.