From 535fd17a42b6b9a110c28ac298e5ac9e1e3379f4 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Thu, 22 Jun 2023 08:30:25 -0400 Subject: [PATCH] simplify null check --- src/main/java/baritone/behavior/ElytraBehavior.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/behavior/ElytraBehavior.java b/src/main/java/baritone/behavior/ElytraBehavior.java index a6fd769d0..da2b4f41b 100644 --- a/src/main/java/baritone/behavior/ElytraBehavior.java +++ b/src/main/java/baritone/behavior/ElytraBehavior.java @@ -123,12 +123,10 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H }) .whenComplete((result, ex) -> { this.recalculating = false; - if (ex != null) { - if (ex instanceof PathCalculationException) { - logDirect("Failed to compute path to destination"); - } else { - logUnhandledException(ex); - } + if (ex instanceof PathCalculationException) { + logDirect("Failed to compute path to destination"); + } else if (ex != null) { + logUnhandledException(ex); } }); }