Skip to content

Commit 338608d

Browse files
committed
fix: nil pointer on certain coldstart executions
1 parent 3051991 commit 338608d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ to interact and monitor the Scroll Application`,
166166
finish := coldStarter.Start(ctx)
167167
executedPort := <-finish
168168

169-
if executedPort.FinishAfterCommand == "" {
169+
if executedPort == nil || executedPort.FinishAfterCommand == "" {
170170
coldStarter.Stop(executedPort.StartDelay)
171171
}
172172

internal/core/services/coldstarter/servers/udp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (u *UDP) Start(ctx context.Context, port int, onFinish func()) error {
4545
n, remoteAddr, err := u.conn.ReadFromUDP(buf)
4646
if err != nil {
4747
if opErr, ok := err.(*net.OpError); ok && opErr.Err.Error() == "use of closed network connection" {
48-
logger.Log().Info("UDP Server stopped")
48+
logger.Log().Info("UDP Server stopped", zap.Error(err))
4949
return
5050
}
5151
logger.Log().Warn("Error reading from UDP connection", zap.Error(err))

0 commit comments

Comments
 (0)