Skip to content

Commit

Permalink
A hack to fix the nil pointer issue of java client's sync workflow re…
Browse files Browse the repository at this point in the history
…quests (#6561)
  • Loading branch information
Shaddoll authored Dec 13, 2024
1 parent b5628a7 commit 339f04f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/types/mapper/proto/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5145,7 +5145,7 @@ func FromHistoryEventArray(t []*types.HistoryEvent) []*apiv1.HistoryEvent {

func ToHistoryEventArray(t []*apiv1.HistoryEvent) []*types.HistoryEvent {
if t == nil {
return nil
return []*types.HistoryEvent{}
}
v := make([]*types.HistoryEvent, len(t))
for i := range t {
Expand Down
4 changes: 2 additions & 2 deletions common/types/mapper/proto/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func TestHealthResponse(t *testing.T) {
}
}
func TestHistory(t *testing.T) {
for _, item := range []*types.History{nil, {}, &testdata.History} {
for _, item := range []*types.History{nil, &testdata.History} {
assert.Equal(t, item, ToHistory(FromHistory(item)))
}
}
Expand Down Expand Up @@ -872,7 +872,7 @@ func TestDataBlobArray(t *testing.T) {
}
}
func TestHistoryEventArray(t *testing.T) {
for _, item := range [][]*types.HistoryEvent{nil, {}, testdata.HistoryEventArray} {
for _, item := range [][]*types.HistoryEvent{{}, testdata.HistoryEventArray} {
assert.Equal(t, item, ToHistoryEventArray(FromHistoryEventArray(item)))
}
}
Expand Down

0 comments on commit 339f04f

Please sign in to comment.