From 47dc0f9b941a6d9c8643cc9a03986998a6940498 Mon Sep 17 00:00:00 2001 From: Brady Date: Wed, 21 Jun 2023 21:30:04 -0500 Subject: [PATCH] Add missing exception null check to async completed callback --- src/main/java/baritone/behavior/ElytraBehavior.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/baritone/behavior/ElytraBehavior.java b/src/main/java/baritone/behavior/ElytraBehavior.java index b63d81a33..a6fd769d0 100644 --- a/src/main/java/baritone/behavior/ElytraBehavior.java +++ b/src/main/java/baritone/behavior/ElytraBehavior.java @@ -177,10 +177,12 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H }) .whenComplete((result, ex) -> { this.recalculating = false; - if (ex instanceof PathCalculationException) { - logDirect("Failed to compute next segment"); - } else { - logUnhandledException(ex); + if (ex != null) { + if (ex instanceof PathCalculationException) { + logDirect("Failed to compute next segment"); + } else { + logUnhandledException(ex); + } } }); }