Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf882597 authored by Joshua Duong's avatar Joshua Duong Committed by Gerrit Code Review
Browse files

Merge "[adb] Check for null in mdns connect info."

parents e72b290c 282385f8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -680,6 +680,13 @@ std::string mdns_list_discovered_services() {
std::optional<MdnsInfo> mdns_get_connect_service_info(std::string_view name) {
    CHECK(!name.empty());

    // only adb server creates these registries
    if (!ResolvedService::sAdbTransportServices && !ResolvedService::sAdbSecureConnectServices) {
        return std::nullopt;
    }
    CHECK(ResolvedService::sAdbTransportServices);
    CHECK(ResolvedService::sAdbSecureConnectServices);

    auto mdns_instance = mdns::mdns_parse_instance_name(name);
    if (!mdns_instance.has_value()) {
        D("Failed to parse mDNS name [%s]", name.data());