Fix NullPointerException when creating mini load in LoadManager (#1565)
The catch statement cancel the load job in the function named createMiniLoad. But sometimes, the load job hasn't been created in catch statement. It will throw the NullPointerException when the load job is cancelled. This commit fix this bug.
This commit is contained in:
@ -149,7 +149,9 @@ public class LoadManager implements Writable{
|
||||
.stream().filter(entity -> entity.getState() != JobState.CANCELLED).findFirst()
|
||||
.get().getTransactionId();
|
||||
} catch (UserException e) {
|
||||
loadJob.cancelJobWithoutCheck(new FailMsg(LOAD_RUN_FAIL, e.getMessage()), false);
|
||||
if (loadJob != null) {
|
||||
loadJob.cancelJobWithoutCheck(new FailMsg(LOAD_RUN_FAIL, e.getMessage()), false);
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
writeUnlock();
|
||||
|
||||
Reference in New Issue
Block a user