Skip to content

Commit

Permalink
fix(windows): Fixed a crash when DNS client is stopping on Windows.
Browse files Browse the repository at this point in the history
Fix crash when dns client is stop on windows
  • Loading branch information
Skyost authored Jul 15, 2024
2 parents a5fb3c1 + 59ae5fd commit 5941f71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bonsoir_windows/windows/bonsoir_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace bonsoir_windows {
onEvent(successObjectPtr, successParameters);
}

void onError(EncodableValue details, std::list<std::string> parameters = std::list<std::string>(), std::optional<std::string> message = nullptr) {
void onError(EncodableValue details, std::list<std::string> parameters = std::list<std::string>(), std::optional<std::string> message = std::nullopt) {
std::string errorMessage = format(message.value_or(logMessages.find(action + "Error")->second), parameters);

std::shared_ptr<ErrorObject> errorObjectPtr = std::make_shared<ErrorObject>(errorMessage, details);
Expand Down
3 changes: 3 additions & 0 deletions packages/bonsoir_windows/windows/bonsoir_broadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ namespace bonsoir_windows {
if (!(broadcast->isRunning())) {
return;
}
if (instance == nullptr || instance->pszInstanceName == nullptr) {
return;
}
std::string name = std::get<0>(parseBonjourFqdn(toUtf8(instance->pszInstanceName)));
if (name == "") {
return;
Expand Down

0 comments on commit 5941f71

Please sign in to comment.