From d99e0fcce93d394726a66d71a774b14809b06c27 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 3 Jan 2025 10:26:39 +0100 Subject: [PATCH] fix: Prevent empty hostname for atlantis Signed-off-by: Philippe Weidmann --- kDriveCore/Utils/Logging.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kDriveCore/Utils/Logging.swift b/kDriveCore/Utils/Logging.swift index 3a1b63316..bd0d6658c 100644 --- a/kDriveCore/Utils/Logging.swift +++ b/kDriveCore/Utils/Logging.swift @@ -83,10 +83,14 @@ public enum Logging { private static func initNetworkLogging() { #if DEBUG @InjectService var appContextService: AppContextServiceable - if !appContextService.isExtension, - appContextService.context != .appTests { - Atlantis.start(hostName: ProcessInfo.processInfo.environment["hostname"]) + guard let hostname = ProcessInfo.processInfo.environment["hostname"], + !hostname.isEmpty, + !appContextService.isExtension, + appContextService.context != .appTests else { + return } + + Atlantis.start(hostName: hostname) #endif }