From 1182f64f287d43d2cf9d8fb90e684ccfc2fe4a2b Mon Sep 17 00:00:00 2001 From: elega <445092967@qq.com> Date: Wed, 8 Nov 2023 00:35:38 +0800 Subject: [PATCH] Fix NPE ### What changes are proposed in this pull request? Please outline the changes and how this PR fixes the issue. ### Why are the changes needed? Please clarify why the changes are needed. For instance, 1. If you propose a new API, clarify the use case for a new API. 2. If you fix a bug, describe the bug. ### Does this PR introduce any user facing changes? Please list the user-facing changes introduced by your change, including 1. change in user-facing APIs 2. addition or removal of property keys 3. webui pr-link: Alluxio/alluxio#18391 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(); } }