Skip to content

Commit

Permalink
fix(Pod Console): bug causing crash (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanJosipovic authored Jan 14, 2025
1 parent f9c638e commit e0199ba
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/KubeUI/ViewModels/Workloads/Pod/PodConsoleViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,24 @@ protected override void ColorizeLine(DocumentLine line)

for (var cell = 0; cell < line.Length; cell++)
{
var cd = _terminal.Buffer.Lines[line.LineNumber - 1][cell];
colors[cell] = GenerateHighlightingColor(cd);
if (_terminal.Buffer.Lines.Length > line.LineNumber - 1)
{
var row = _terminal.Buffer.Lines[line.LineNumber - 1];

if (row.Length > cell)
{
var cd = row[cell];
colors[cell] = GenerateHighlightingColor(cd);
}
else
{
colors[cell] = new HighlightingColor();
}
}
else
{
colors[cell] = new HighlightingColor();
}
}

int startOffset = line.Offset;
Expand Down

0 comments on commit e0199ba

Please sign in to comment.