Skip to content

Commit

Permalink
fix LOGBACK-1737
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed May 2, 2023
1 parent f93f3bb commit f7ae802
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Optional;

import ch.qos.logback.core.joran.spi.ConsoleTarget;
Expand Down Expand Up @@ -109,7 +110,7 @@ private OutputStream wrapWithJansi(OutputStream targetStream) {
.filter(m -> PrintStream.class.isAssignableFrom(m.getReturnType()))
.findAny();
if (optOutMethod.isPresent()) {
final Method outMethod = optOutMethod.orElseThrow();
final Method outMethod = optOutMethod.orElseThrow(() -> new NoSuchElementException("No value present"));
return (PrintStream) outMethod.invoke(null);
}

Expand Down

0 comments on commit f7ae802

Please sign in to comment.