Skip to content

Commit 45a712f

Browse files
committed
fix nil timestamp issue
1 parent 51e71fe commit 45a712f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

api/GrpcHandler.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,18 @@ func (impl *GrpcHandlerImpl) FetchChanges(ctx context.Context, req *pb.FetchScmC
206206
}
207207
}
208208

209-
return &pb.MaterialChangeResponse{
209+
mappedRes := &pb.MaterialChangeResponse{
210210
Commits: pbGitCommits,
211-
LastFetchTime: timestamppb.New(res.LastFetchTime),
212211
IsRepoError: res.IsRepoError,
213212
RepoErrorMsg: res.RepoErrorMsg,
214213
IsBranchError: res.IsBranchError,
215214
BranchErrorMsg: res.BranchErrorMsg,
216-
}, nil
215+
}
216+
217+
if !res.LastFetchTime.IsZero() {
218+
mappedRes.LastFetchTime = timestamppb.New(res.LastFetchTime)
219+
}
220+
return mappedRes, nil
217221
}
218222

219223
func (impl *GrpcHandlerImpl) GetHeadForPipelineMaterials(ctx context.Context, req *pb.HeadRequest) (

0 commit comments

Comments
 (0)