Skip to content

Commit

Permalink
fix: nil pointer on certain coldstart executions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcStdt committed Nov 21, 2024
1 parent 3051991 commit 338608d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ to interact and monitor the Scroll Application`,
finish := coldStarter.Start(ctx)
executedPort := <-finish

if executedPort.FinishAfterCommand == "" {
if executedPort == nil || executedPort.FinishAfterCommand == "" {
coldStarter.Stop(executedPort.StartDelay)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/core/services/coldstarter/servers/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (u *UDP) Start(ctx context.Context, port int, onFinish func()) error {
n, remoteAddr, err := u.conn.ReadFromUDP(buf)
if err != nil {
if opErr, ok := err.(*net.OpError); ok && opErr.Err.Error() == "use of closed network connection" {
logger.Log().Info("UDP Server stopped")
logger.Log().Info("UDP Server stopped", zap.Error(err))
return
}
logger.Log().Warn("Error reading from UDP connection", zap.Error(err))
Expand Down

0 comments on commit 338608d

Please sign in to comment.