]> git.lyx.org Git - lyx.git/commitdiff
Simplify code
authorScott Kostyshak <skostysh@lyx.org>
Sat, 4 Apr 2015 18:56:29 +0000 (14:56 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Sat, 4 Apr 2015 18:56:29 +0000 (14:56 -0400)
src/support/Systemcall.cpp

index 2f277f6b9ec060cdfc665b525a47ad1ab55301ca..28cbdc89999d8721616a700d88d306b16dc59b08 100644 (file)
@@ -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();
 }