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
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 6 additions and 4 deletions

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