From c246e94fb565cbf1798cb2e90160077eed75e408 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Mon, 5 Sep 2011 02:11:41 +0800 Subject: [PATCH] Check whether the pointer _shellProcess is null before using it. --- src/Session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Session.cpp b/src/Session.cpp index 9300adc4e..6a9592d1c 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -156,7 +156,7 @@ Session::Session(QObject* parent) : void Session::openTeletype(int fd) { - if (_shellProcess && isRunning()) + if ( isRunning() ) { kWarning() << "Attempted to open teletype in a running session."; return; @@ -224,7 +224,7 @@ bool Session::hasDarkBackground() const } bool Session::isRunning() const { - return _shellProcess->state() == QProcess::Running; + return _shellProcess && ( _shellProcess->state() == QProcess::Running ); } void Session::setCodec(QTextCodec* codec)