From 4d920bb2e20c8b00f2641021305c297267df4c80 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Fri, 16 Sep 2022 12:01:42 -0300 Subject: [PATCH] Fix macos We don't have a resolver on macos, so we were running through this loop with fails == 0 == m_Impls.size() and throwing, crashing the process. Early return to avoid the failure and fix macos crash. --- llarp/dns/platform.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llarp/dns/platform.cpp b/llarp/dns/platform.cpp index 012467b97..a6cf24d4b 100644 --- a/llarp/dns/platform.cpp +++ b/llarp/dns/platform.cpp @@ -11,6 +11,8 @@ namespace llarp::dns void Multi_Platform::set_resolver(unsigned int index, llarp::SockAddr dns, bool global) { + if (m_Impls.empty()) + return; size_t fails{0}; for (const auto& ptr : m_Impls) {