diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 2f277f6b9e..28cbdc8999 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -607,13 +607,11 @@ QString SystemcallPrivate::exitStatusMessage() const int SystemcallPrivate::exitCode() { - if (!process_) - return -1; - // From Qt's documentation, in regards to QProcess::exitCode(), // "This value is not valid unless exitStatus() returns NormalExit" - if (process_->exitStatus() != QProcess::NormalExit) + if (!process_ || process_->exitStatus() != QProcess::NormalExit) return -1; + return process_->exitCode(); }