Skip to content

Commit

Permalink
Debugger: Create check for successful QString conversion in MemoryVie…
Browse files Browse the repository at this point in the history
…werWidget.cpp
  • Loading branch information
TheTechnician27 authored and refractionpcsx2 committed Feb 6, 2024
1 parent dccba86 commit 88672dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pcsx2-qt/Debugger/MemoryViewWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,11 @@ bool MemoryViewTable::KeyPress(int key, QChar keychar)

if (keyCharIsText)
{
InsertIntoSelectedHexView(((u8)QString(QChar(key)).toInt(&pressHandled, 16)));
// Check if key pressed is hex before insertion (QString conversion fails otherwise)
const u8 keyPressed = (u8)QString(QChar(key)).toInt(&pressHandled, 16);
if (pressHandled)
{
InsertIntoSelectedHexView(keyPressed);
// Increment to the next nibble or byte
if ((selectedNibbleHI = !selectedNibbleHI))
UpdateSelectedAddress(selectedAddress + 1);
Expand Down

0 comments on commit 88672dc

Please sign in to comment.