diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index c1fb7beb..32c40e69 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -870,16 +870,17 @@ void DisassemblyLeftPanel::paintEvent(QPaintEvent *event) p.fillRect(event->rect(), Config()->getColor("gui.background").darker(115)); QList lines = disas->getLines(); + if (lines.size() == 0) { + // No line to print, abort early + return; + } using LineInfo = std::pair; std::vector lineOffsets; lineOffsets.reserve(lines.size() + arrows.size()); RVA minViewOffset = 0, maxViewOffset = 0; - - if (lines.size() > 0) { - minViewOffset = maxViewOffset = lines[0].offset; - } + minViewOffset = maxViewOffset = lines[0].offset; for (int i = 0; i < lines.size(); i++) { lineOffsets.emplace_back(lines[i].offset, i);