Skip to content

Commit

Permalink
Avoid crash when an unknown debug adapter is encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Jun 19, 2023
1 parent d3b0a7e commit f891dcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,11 @@ void BNDebuggerSetAdapterType(BNDebuggerController* controller, const char* adap

BNDebugAdapterType* BNGetDebugAdapterTypeByName(const char* name)
{
return DebugAdapterType::GetByName(name)->GetAPIObject();
DebugAdapterType* type = DebugAdapterType::GetByName(name);
if (!type)
return nullptr;

return type->GetAPIObject();
}


Expand Down

0 comments on commit f891dcf

Please sign in to comment.