Skip to content

Commit

Permalink
Protect against possible panic in onBuildFileError
Browse files Browse the repository at this point in the history
  • Loading branch information
danenania committed Apr 5, 2024
1 parent caff7c5 commit 091db00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/server/model/plan/build_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,12 @@ func (fileState *activeBuildStreamFileState) onBuildFileError(err error) {
activeBuild.Success = false
activeBuild.Error = err

activePlan.StreamDoneCh <- &shared.ApiError{
Type: shared.ApiErrorTypeOther,
Status: http.StatusInternalServerError,
Msg: err.Error(),
if activePlan != nil {
activePlan.StreamDoneCh <- &shared.ApiError{
Type: shared.ApiErrorTypeOther,
Status: http.StatusInternalServerError,
Msg: err.Error(),
}
}

if err != nil {
Expand Down

0 comments on commit 091db00

Please sign in to comment.