diff --git a/CHANGELOG.md b/CHANGELOG.md index d46bc40..60f6d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/grpc/service/studyinfo_endpoints.go b/pkg/grpc/service/studyinfo_endpoints.go index 20ef0b2..b181581 100644 --- a/pkg/grpc/service/studyinfo_endpoints.go +++ b/pkg/grpc/service/studyinfo_endpoints.go @@ -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, }