Skip to content

Commit e73d456

Browse files
committed
fix<mapper> null pointer in request mappers
Signed-off-by: Shijie Sheng <liouvetren@gmail.com>
1 parent 8f860b9 commit e73d456

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/uber/cadence/internal/compatibility/proto/mappers/DecisionMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static Decision decision(com.uber.cadence.Decision d) {
157157
d.getRequestCancelExternalWorkflowExecutionDecisionAttributes();
158158
RequestCancelExternalWorkflowExecutionDecisionAttributes.Builder builder =
159159
RequestCancelExternalWorkflowExecutionDecisionAttributes.newBuilder()
160-
.setDomain(attr.getDomain())
160+
.setDomain(attr.getDomain() != null ? attr.getDomain() : "")
161161
.setWorkflowExecution(workflowRunPair(attr.getWorkflowId(), attr.getRunId()))
162162
.setChildWorkflowOnly(attr.isChildWorkflowOnly());
163163
if (attr.getControl() != null) {

src/main/java/com/uber/cadence/internal/compatibility/proto/mappers/TypeMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static WorkflowExecution workflowRunPair(String workflowId, String runId) {
128128
if (Strings.isNullOrEmpty(workflowId) && Strings.isNullOrEmpty(runId)) {
129129
return WorkflowExecution.newBuilder().build();
130130
}
131-
return WorkflowExecution.newBuilder().setWorkflowId(workflowId).setRunId(runId).build();
131+
return WorkflowExecution.newBuilder().setWorkflowId(workflowId).setRunId(runId != null ? runId : "").build();
132132
}
133133

134134
static ActivityType activityType(com.uber.cadence.ActivityType t) {
@@ -275,7 +275,7 @@ static WorkflowExecutionFilter workflowExecutionFilter(
275275
}
276276
return WorkflowExecutionFilter.newBuilder()
277277
.setWorkflowId(t.getWorkflowId())
278-
.setRunId(t.getRunId())
278+
.setRunId(t.getRunId() != null ? t.getRunId() : "")
279279
.build();
280280
}
281281

0 commit comments

Comments
 (0)