Check for valid _foregroundProcessInfo to prevent crash

Summary:
In Session::getUrl() check that _foregroundProcessInfo is valid before
tyring to access its members.

I couldn't reproduce the crash from the BR, but it is logical to call
isValid() before accessing any ProcessInfo object members.

BUG: 391447

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12175
wilder-portage
Ahmad Samir 8 years ago committed by Kurt Hindenburg
parent 3593debc5a
commit 916ff8f829
  1. 2
      src/Session.cpp

@ -1157,7 +1157,7 @@ QUrl Session::getUrl()
bool ok = false;
// check if foreground process is bookmark-able
if (isForegroundProcessActive()) {
if (isForegroundProcessActive() && _foregroundProcessInfo->isValid()) {
// for remote connections, save the user and host
// bright ideas to get the directory at the other end are welcome :)
if (_foregroundProcessInfo->name(&ok) == QLatin1String("ssh") && ok) {

Loading…
Cancel
Save