Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 6811513

Browse files
committed
fix(plugins/plugin-kubectl): logs tab may fail badly with Null pointer
infinite loop
1 parent 7d47848 commit 6811513

File tree

1 file changed

+3
-1
lines changed
  • plugins/plugin-kubectl/src/lib/view/modes

1 file changed

+3
-1
lines changed

plugins/plugin-kubectl/src/lib/view/modes/Logs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ export default class Logs extends Terminal<State> {
150150
const container = containerName ? `-c ${containerName}` : '--all-containers'
151151
const isMulti = this.isMulti()
152152

153+
const parsedOptions = args.parsedOptions || {}
154+
153155
if (args.argsForMode && args.argsForMode.command && (!isMulti || !containerName)) {
154156
// 1) if the user specified no container, we will inject
155157
// --all-containers for convenience
@@ -163,7 +165,7 @@ export default class Logs extends Terminal<State> {
163165
args.argsForMode.command = undefined // point 2
164166
}
165167

166-
return { command, isLive: args.parsedOptions.f ? ('Live' as const) : ('Paused' as const) }
168+
return { command, isLive: parsedOptions.f ? ('Live' as const) : ('Paused' as const) }
167169
} else {
168170
// pod:container? a sign of a multi-pod view
169171
const previous =

0 commit comments

Comments
 (0)