kubectl: Fix panic in exec terminal size queue

Check if delegate is nil before calling Next() in terminalSizeQueueAdapter
to prevent a nil pointer dereference.

Kubernetes-commit: 72a5892dca945f000a30c7a763aa0696964b7e50
This commit is contained in:
Marcos Guillermo 2025-12-23 17:37:59 -03:00 committed by Kubernetes Publisher
parent 817cfc8d4f
commit 6b218dd38b

View file

@ -411,6 +411,10 @@ type terminalSizeQueueAdapter struct {
}
func (a *terminalSizeQueueAdapter) Next() *remotecommand.TerminalSize {
if a.delegate == nil {
return nil
}
next := a.delegate.Next()
if next == nil {
return nil