File tree Expand file tree Collapse file tree 2 files changed +1
-23
lines changed
Expand file tree Collapse file tree 2 files changed +1
-23
lines changed Original file line number Diff line number Diff line change 7373func NewGrpcConnection (ctx context.Context , agentConfig * config.Config ,
7474 commandConfig * config.Command ,
7575) (* GrpcConnection , error ) {
76- if commandConfig == nil || commandConfig .Server .Type != config .Grpc {
76+ if commandConfig == nil || commandConfig .Server == nil || commandConfig . Server .Type != config .Grpc {
7777 return nil , errors .New ("invalid command server settings" )
7878 }
7979
Original file line number Diff line number Diff line change @@ -638,25 +638,3 @@ func Test_serverAddress(t *testing.T) {
638638 })
639639 }
640640}
641-
642- func Test_serverAddress_NilCommand (t * testing.T ) {
643- ctx := context .Background ()
644-
645- // Test with nil command config - should panic as the function doesn't handle nil
646- assert .Panics (t , func () {
647- serverAddress (ctx , nil )
648- }, "serverAddress should panic with nil command config" )
649- }
650-
651- func Test_serverAddress_NilServer (t * testing.T ) {
652- ctx := context .Background ()
653-
654- // Test with nil server config - should also panic
655- commandConfig := & config.Command {
656- Server : nil ,
657- }
658-
659- assert .Panics (t , func () {
660- serverAddress (ctx , commandConfig )
661- }, "serverAddress should panic with nil server config" )
662- }
You can’t perform that action at this time.
0 commit comments