From e5a4005c2d13f13e9a8a4bece99b42dcc4721d03 Mon Sep 17 00:00:00 2001 From: Zijian Date: Tue, 17 Dec 2024 10:47:10 -0800 Subject: [PATCH] Fix nil pointer issue --- .../uber/cadence/internal/common/WorkflowExecutionUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/uber/cadence/internal/common/WorkflowExecutionUtils.java b/src/main/java/com/uber/cadence/internal/common/WorkflowExecutionUtils.java index 067c3e0b..5d9add40 100644 --- a/src/main/java/com/uber/cadence/internal/common/WorkflowExecutionUtils.java +++ b/src/main/java/com/uber/cadence/internal/common/WorkflowExecutionUtils.java @@ -226,7 +226,8 @@ private static HistoryEvent getInstanceCloseEvent( pageToken = response.getNextPageToken(); History history = response.getHistory(); - if (history != null && history.getEvents().size() > 0) { + + if (history != null && history.getEvents() != null && history.getEvents().size() > 0) { event = history.getEvents().get(0); if (!isWorkflowExecutionCompletedEvent(event)) { throw new RuntimeException("Last history event is not completion event: " + event);