LookupServer: Return with failure result when lookup fails
This was missed in 4ca0669d1e
and the
error condition would still fall through to an ErrorOr unwrapping which
caused a crash.
This commit is contained in:
parent
82a515a748
commit
e212514bbf
Notes:
sideshowbarker
2024-07-17 17:03:48 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/e212514bbf Pull-request: https://github.com/SerenityOS/serenity/pull/13149
1 changed files with 2 additions and 0 deletions
|
@ -33,6 +33,7 @@ Messages::LookupServer::LookupNameResponse ConnectionFromClient::lookup_name(Str
|
|||
auto maybe_answers = LookupServer::the().lookup(name, DNSRecordType::A);
|
||||
if (maybe_answers.is_error()) {
|
||||
dbgln("LookupServer: Failed to lookup PTR record: {}", maybe_answers.error());
|
||||
return { 1, {} };
|
||||
}
|
||||
|
||||
auto answers = maybe_answers.release_value();
|
||||
|
@ -57,6 +58,7 @@ Messages::LookupServer::LookupAddressResponse ConnectionFromClient::lookup_addre
|
|||
auto maybe_answers = LookupServer::the().lookup(name, DNSRecordType::PTR);
|
||||
if (maybe_answers.is_error()) {
|
||||
dbgln("LookupServer: Failed to lookup PTR record: {}", maybe_answers.error());
|
||||
return { 1, String() };
|
||||
}
|
||||
|
||||
auto answers = maybe_answers.release_value();
|
||||
|
|
Loading…
Add table
Reference in a new issue