Skip to content

Commit 80eedaf

Browse files
jentingroboquat
authored andcommitted
The instance ID is required field
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 46cca98 commit 80eedaf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/ws-daemon/pkg/content/service.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,10 @@ func (s *WorkspaceService) TakeSnapshot(ctx context.Context, req *api.TakeSnapsh
763763
span.SetTag("workspace", req.Id)
764764
defer tracing.FinishSpan(span, &err)
765765

766+
if req.Id == "" {
767+
return nil, status.Error(codes.InvalidArgument, "ID is required")
768+
}
769+
766770
sess := s.store.Get(req.Id)
767771
if sess == nil {
768772
return nil, status.Error(codes.NotFound, "cannot find workspace during TakeSnapshot")
@@ -822,6 +826,10 @@ func (s *WorkspaceService) BackupWorkspace(ctx context.Context, req *api.BackupW
822826
span.SetTag("workspace", req.Id)
823827
defer tracing.FinishSpan(span, &err)
824828

829+
if req.Id == "" {
830+
return nil, status.Error(codes.InvalidArgument, "ID is required")
831+
}
832+
825833
sess := s.store.Get(req.Id)
826834
if sess == nil {
827835
// TODO(rl): do we want to fake a session just to see if we can access the location

0 commit comments

Comments
 (0)