File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,13 @@ func WithDevcontainers(devcontainers []codersdk.WorkspaceAgentDevcontainer, scri
113
113
break
114
114
}
115
115
}
116
+ if api .devcontainerLogSourceIDs [devcontainer .WorkspaceFolder ] == uuid .Nil {
117
+ api .logger .Error (api .ctx , "devcontainer log source ID not found for devcontainer" ,
118
+ slog .F ("devcontainer" , devcontainer .Name ),
119
+ slog .F ("workspace_folder" , devcontainer .WorkspaceFolder ),
120
+ slog .F ("config_path" , devcontainer .ConfigPath ),
121
+ )
122
+ }
116
123
}
117
124
}
118
125
}
@@ -164,6 +171,8 @@ func NewAPI(logger slog.Logger, options ...Option) *API {
164
171
configFileModifiedTimes : make (map [string ]time.Time ),
165
172
scriptLogger : func (uuid.UUID ) ScriptLogger { return noopScriptLogger {} },
166
173
}
174
+ // The ctx and logger must be set before applying options to avoid
175
+ // nil pointer dereference.
167
176
for _ , opt := range options {
168
177
opt (api )
169
178
}
You can’t perform that action at this time.
0 commit comments