Skip to content

Commit

Permalink
fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Lombardi committed Mar 4, 2025
1 parent 04522e3 commit 239daeb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/types/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func (w *Workspace) ToProto() *pb.Workspace {
concurrencyLimit = w.ConcurrencyLimit.ToProto()
}

storage := &pb.WorkspaceStorage{}
if w.Storage != nil {
storage = w.Storage.ToProto()
}

return &pb.Workspace{
Id: uint32(w.Id),
ExternalId: w.ExternalId,
Expand All @@ -56,7 +61,7 @@ func (w *Workspace) ToProto() *pb.Workspace {
VolumeCacheEnabled: w.VolumeCacheEnabled,
MultiGpuEnabled: w.MultiGpuEnabled,
ConcurrencyLimit: concurrencyLimit,
Storage: w.Storage.ToProto(),
Storage: storage,
}
}

Expand All @@ -66,6 +71,11 @@ func NewWorkspaceFromProto(in *pb.Workspace) *Workspace {
concurrencyLimit = NewConcurrencyLimitFromProto(in.ConcurrencyLimit)
}

storage := &WorkspaceStorage{}
if in.Storage != nil {
storage = NewWorkspaceStorageFromProto(in.Storage)
}

return &Workspace{
Id: uint(in.Id),
ExternalId: in.ExternalId,
Expand All @@ -74,6 +84,7 @@ func NewWorkspaceFromProto(in *pb.Workspace) *Workspace {
VolumeCacheEnabled: in.VolumeCacheEnabled,
MultiGpuEnabled: in.MultiGpuEnabled,
ConcurrencyLimit: concurrencyLimit,
Storage: storage,
}
}

Expand Down

0 comments on commit 239daeb

Please sign in to comment.