code cleanup osinfo

This commit is contained in:
Sebastian Hildebrandt 2019-05-30 20:16:59 +02:00
parent b694316c82
commit 604dd02b13

View File

@ -589,8 +589,7 @@ function versions(callback) {
if (_darwin) {
// check if any JVM is installed but avoid dialog box that Java needs to be installed
exec('/usr/libexec/java_home -V 2>&1', function (error, stdout) {
const output = stdout.toString().toLowerCase();
if (output.indexOf('no java runtime') === -1) {
if (!error && stdout.toString().toLowerCase().indexOf('no java runtime') === -1) {
// now this can be done savely
exec('java -version 2>&1', function (error, stdout) {
if (!error) {