mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
fix: Undefined behaviour when sending empty arguments to main instance
This commit is contained in:
@@ -15,12 +15,13 @@ namespace hex::messaging {
|
||||
|
||||
void setupEvents() {
|
||||
SendMessageToMainInstance::subscribe([](const std::string &eventName, const std::vector<u8> &eventData) {
|
||||
log::debug("Forwarding message {} (maybe to us)", eventName);
|
||||
if (ImHexApi::System::isMainInstance()) {
|
||||
log::debug("Executing message '{}' in current instance", eventName);
|
||||
EventImHexStartupFinished::subscribe([eventName, eventData]{
|
||||
ImHexApi::Messaging::impl::runHandler(eventName, eventData);
|
||||
});
|
||||
} else {
|
||||
log::debug("Forwarding message '{}' to existing instance", eventName);
|
||||
sendToOtherInstance(eventName, eventData);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user