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: 5f675740442edc32f2dcbbe1453f49484440e7a8
This commit is contained in:
Marcos Guillermo 2025-12-23 17:37:59 -03:00 committed by Kubernetes Publisher
parent 6f1e4558bb
commit de9c08efa2

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