Qt: Fix crash when first CLI command is empty (fixes #693)
Vicki Pfau vi@endrift.com
Sat, 22 Apr 2017 00:41:58 -0700
1 files changed,
3 insertions(+),
0 deletions(-)
M
src/platform/qt/DebuggerConsoleController.cpp
→
src/platform/qt/DebuggerConsoleController.cpp
@@ -88,6 +88,9 @@ Backend* consoleBe = reinterpret_cast<Backend*>(be);
DebuggerConsoleController* self = consoleBe->self; GameController::Interrupter interrupter(self->m_gameController, true); QMutexLocker lock(&self->m_mutex); + if (self->m_history.isEmpty()) { + return nullptr; + } self->m_last = self->m_history.last().toUtf8(); return self->m_last.constData(); }