Skip to content

Commit

Permalink
fix issue with missing condition
Browse files Browse the repository at this point in the history
  • Loading branch information
phev8 committed Apr 23, 2021
1 parent b023df5 commit 5280415
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Changed how survey version ID is generated, to use a shorter format (YY-MM-counter).

### Fixed

- `HasParticipantStateWithCondition` should handle case without condition as well. (When condition is nil)

## [v0.14.0]

### Added
Expand Down
8 changes: 7 additions & 1 deletion pkg/grpc/service/studyinfo_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ func (s *studyServiceServer) HasParticipantStateWithCondition(ctx context.Contex
}

cond := types.ExpressionArgFromAPI(req.Condition)
if cond.IsExpression() {
if cond == nil {
return &api.ServiceStatus{
Version: apiVersion,
Status: api.ServiceStatus_NORMAL,
Msg: "participant found in study",
}, nil
} else if cond.IsExpression() {
evalCtx := studyengine.EvalContext{
ParticipantState: pState,
}
Expand Down

0 comments on commit 5280415

Please sign in to comment.