mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:18:11 +00:00
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
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
Add a link
Reference in a new issue