mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
Ladybird: Fix JS console crash when history is empty
Do not try to navigate JS console history forward when it is empty. A crash was occurring because of size_t underflow.
This commit is contained in:
parent
cd0fe4bb48
commit
05fc63932b
1 changed files with 2 additions and 0 deletions
|
@ -175,6 +175,8 @@ void ConsoleInputEdit::keyPressEvent(QKeyEvent* event)
|
|||
{
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Down: {
|
||||
if (m_history.is_empty())
|
||||
break;
|
||||
auto last_index = m_history.size() - 1;
|
||||
if (m_history_index < last_index) {
|
||||
m_history_index++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue