Skip to content

Commit 6ff7f54

Browse files
authored
[java] fix bug for appium subclass that sets neither log file nor out… (#12696)
[java] fix bug for appium subclass that sets neither log file nor output stream
1 parent d78a8ec commit 6ff7f54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/src/org/openqa/selenium/remote/service/DriverService.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,12 @@ protected Duration getDefaultTimeout() {
444444
}
445445

446446
protected OutputStream getLogOutput() {
447+
if (logOutputStream != null) {
448+
return logOutputStream;
449+
}
447450
try {
448-
return logOutputStream != null ? logOutputStream : new FileOutputStream(logFile);
451+
File logFile = getLogFile();
452+
return logFile == null ? ByteStreams.nullOutputStream() : new FileOutputStream(logFile);
449453
} catch (FileNotFoundException e) {
450454
throw new RuntimeException(e);
451455
}

0 commit comments

Comments
 (0)