Skip to content

Commit 6b218dd

Browse files
MarcosDaNightk8s-publishing-bot
authored andcommitted
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
1 parent 817cfc8 commit 6b218dd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/cmd/exec/exec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ type terminalSizeQueueAdapter struct {
411411
}
412412

413413
func (a *terminalSizeQueueAdapter) Next() *remotecommand.TerminalSize {
414+
if a.delegate == nil {
415+
return nil
416+
}
417+
414418
next := a.delegate.Next()
415419
if next == nil {
416420
return nil

0 commit comments

Comments
 (0)