mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash when first CLI command is empty (fixes #693)
This commit is contained in:
parent
2d930cbc61
commit
8c095ec885
|
@ -88,6 +88,9 @@ const char* DebuggerConsoleController::historyLast(struct CLIDebuggerBackend* 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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue