mirror of
https://github.com/KDE/konsole.git
synced 2026-05-19 03:57:43 -04:00
we could arrive here with already destructed currentTerminalDisplay()
avoid nullptr access BUG: 519274
This commit is contained in:
@@ -2368,7 +2368,12 @@ void Screen::addHistLine()
|
||||
if (newHistLines <= oldHistLines) {
|
||||
_droppedLines += oldHistLines - newHistLines + 1;
|
||||
|
||||
currentTerminalDisplay()->removeLines(oldHistLines - newHistLines + 1);
|
||||
// we could arrive here with already destructed currentTerminalDisplay()
|
||||
// see bug 519274
|
||||
if (currentTerminalDisplay()) {
|
||||
currentTerminalDisplay()->removeLines(oldHistLines - newHistLines + 1);
|
||||
}
|
||||
|
||||
// We removed some lines, we need to verify if we need to remove a URL.
|
||||
if (_escapeSequenceUrlExtractor) {
|
||||
_escapeSequenceUrlExtractor->historyLinesRemoved(oldHistLines - newHistLines + 1);
|
||||
|
||||
Reference in New Issue
Block a user