Yair Zaslavsky has uploaded a new change for review. Change subject: core: Fix potential NPE ......................................................................
core: Fix potential NPE Fix a potential NPE around setting task status. This issue was reported by coverity Change-Id: I9f82f6d4aeb5adbdb1c33d024b6f7864dbd12899 Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskResultEnum.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HSMGetAllTasksStatusesVDSCommand.java 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/22283/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskResultEnum.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskResultEnum.java index 58582f0..323e8fd 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskResultEnum.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/AsyncTaskResultEnum.java @@ -4,7 +4,8 @@ success, failure, cleanSuccess, - cleanFailure; + cleanFailure, + unknown; public int getValue() { return this.ordinal(); diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HSMGetAllTasksStatusesVDSCommand.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HSMGetAllTasksStatusesVDSCommand.java index 7eea07d..31eb4c3 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HSMGetAllTasksStatusesVDSCommand.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HSMGetAllTasksStatusesVDSCommand.java @@ -43,7 +43,8 @@ task.setException(ex); } - task.setResult((AsyncTaskResultEnum.valueOf(taskStatus.mTaskResult))); + task.setResult(taskStatus != null ? (AsyncTaskResultEnum.valueOf(taskStatus.mTaskResult)) + : AsyncTaskResultEnum.unknown); // Normally, when the result is not 'success', there is an // exception. -- To view, visit http://gerrit.ovirt.org/22283 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f82f6d4aeb5adbdb1c33d024b6f7864dbd12899 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches