From b366b1b1d1aa79185389c5541b3451c436c6179d Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 22 Jun 2023 11:40:45 -0500 Subject: [PATCH] Fix other null checks --- .../baritone/behavior/ElytraBehavior.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/baritone/behavior/ElytraBehavior.java b/src/main/java/baritone/behavior/ElytraBehavior.java index da2b4f41b..5e370fa28 100644 --- a/src/main/java/baritone/behavior/ElytraBehavior.java +++ b/src/main/java/baritone/behavior/ElytraBehavior.java @@ -143,12 +143,10 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H return this.path0(ctx.playerFeet(), this.path.get(upToIncl), segment -> segment.append(after.stream(), complete)) .whenComplete((result, ex) -> { this.recalculating = false; - if (ex != null) { - if (ex instanceof PathCalculationException) { - logDirect("Failed to recompute segment"); - } else { - logUnhandledException(ex); - } + if (ex instanceof PathCalculationException) { + logDirect("Failed to recompute segment"); + } else if (ex != null) { + logUnhandledException(ex); } }); } @@ -175,12 +173,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 next segment"); - } else { - logUnhandledException(ex); - } + if (ex instanceof PathCalculationException) { + logDirect("Failed to compute next segment"); + } else if (ex != null) { + logUnhandledException(ex); } }); }