From 6fbc3cb6571fa8a94c8765b43f7aeed1f5a711ec Mon Sep 17 00:00:00 2001 From: alluxio-bot Date: Tue, 7 Nov 2023 19:39:30 -0800 Subject: [PATCH] Fix NPE Cherry-pick of existing commit. orig-pr: Alluxio/alluxio#18391 orig-commit: Alluxio/alluxio@420e560fb2d31cfeecfdf9b5d170459fc2ab2ee7 orig-commit-author: elega <445092967@qq.com> pr-link: Alluxio/alluxio#18396 change-id: cid-24fcdc50fc0b6560f77c0f2f31ebadd78000bac8 --- .../master/src/main/java/alluxio/master/job/LoadSubTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dora/core/server/master/src/main/java/alluxio/master/job/LoadSubTask.java b/dora/core/server/master/src/main/java/alluxio/master/job/LoadSubTask.java index 834ab0e1ca4d..593f2b6fc111 100644 --- a/dora/core/server/master/src/main/java/alluxio/master/job/LoadSubTask.java +++ b/dora/core/server/master/src/main/java/alluxio/master/job/LoadSubTask.java @@ -106,10 +106,11 @@ public static LoadSubTask from(LoadFailure loadFailure, long virtualBlockSize) { @Override public String toString() { + WorkerInfo workerInfo = getWorkerInfo(); return MoreObjects.toStringHelper(this) .add("UfsPath", getUfsPath()) - .add("ShardingKey", mHashKey.asString()) - .add("Worker", getWorkerInfo().getAddress().toString()) + .add("ShardingKey", mHashKey == null ? null : mHashKey.asString()) + .add("Worker", workerInfo == null ? null : workerInfo.getAddress().toString()) .toString(); } }