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

Commit 4f1c4095 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

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

Change-Id: Ibc07b1c4f7f2ace1093f434f755fc6a17ae79fc6
parents e2ef4c23 cf882597
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());