Skip to content

Commit

Permalink
fix(safe-client): check safe client for nil (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothllm authored Feb 5, 2025
1 parent 59e340f commit 2fe6df8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datastreamer/streamserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,17 @@ func (s *StreamServer) handleConnection(conn net.Conn) {
return
}

// Check if the client is nil
safeClient := s.getSafeClient(clientID)
if safeClient == nil {
log.Errorf("Client %s is nil", clientID)
s.killClient(clientID)
return
}

// Manage the requested command
log.Debugf("Command %d[%s] received from %s", command, StrCommand[Command(command)], clientID)
err = s.processCommand(Command(command), s.getSafeClient(clientID))
err = s.processCommand(Command(command), safeClient)
if err != nil {
log.Errorf("Error processing command %d[%s] from %s: %v", command, StrCommand[Command(command)], clientID, err)
}
Expand Down

0 comments on commit 2fe6df8

Please sign in to comment.