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

Commit a60f2d8c authored by Joshua Duong's avatar Joshua Duong Committed by Automerger Merge Worker
Browse files

Merge "[adb] Check for null in mdns connect info." am: cf882597 am: 4f1c4095

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1340738

Change-Id: I15b95626a658646b98ff628e3c05d56d7a29a930
parents 9f4c5480 4f1c4095
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());