Add missing exception null check to async completed callback

This commit is contained in:
Brady
2023-06-21 21:30:04 -05:00
parent 4776fa1876
commit 47dc0f9b94

View File

@@ -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);
}
}
});
}