mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Crash when choosing Edit -> Disassemble Selection without ever opening disassembler view
Fixes #2149
This commit is contained in:
@@ -29,7 +29,7 @@ namespace hex::plugin::disasm {
|
||||
|
||||
this->disassemble();
|
||||
}, [this]{
|
||||
return ImHexApi::HexEditor::isSelectionValid() && !this->m_disassemblerTask.isRunning();
|
||||
return ImHexApi::HexEditor::isSelectionValid() && !m_disassemblerTask.isRunning() && *m_currArchitecture != nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ namespace hex::plugin::disasm {
|
||||
const auto region = m_regionToDisassemble.get(provider);
|
||||
auto &disassembly = m_disassembly.get(provider);
|
||||
|
||||
if (currArchitecture == nullptr)
|
||||
return;
|
||||
|
||||
// Create a capstone disassembler instance
|
||||
if (currArchitecture->start()) {
|
||||
ON_SCOPE_EXIT {
|
||||
|
||||
Reference in New Issue
Block a user