Skip to content

Commit

Permalink
[java] fix bug for appium subclass that sets neither log file nor out…
Browse files Browse the repository at this point in the history
…put stream
  • Loading branch information
titusfortner committed Sep 6, 2023
1 parent d608538 commit a91302e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,13 @@ protected Duration getDefaultTimeout() {

protected OutputStream getLogOutput() {
try {
return logOutputStream != null ? logOutputStream : new FileOutputStream(logFile);
if (logOutputStream == null && getLogFile() == null) {
return ByteStreams.nullOutputStream();
} else if (logOutputStream == null) {
return new FileOutputStream(getLogFile());
} else {
return logOutputStream;
}
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit a91302e

Please sign in to comment.