all repos — mgba @ 8c095ec885e7131993ee50ae7f1bc9b1ea570128

mGBA Game Boy Advance Emulator

Qt: Fix crash when first CLI command is empty (fixes #693)
Vicki Pfau vi@endrift.com
Sat, 22 Apr 2017 00:41:58 -0700
commit

8c095ec885e7131993ee50ae7f1bc9b1ea570128

parent

2d930cbc610b28d82746bbcd121efcd47be47592

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/DebuggerConsoleController.cppsrc/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(); }