From f4f039d5dc99bd12cd07df523a478cc924a37857 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 22 Aug 2026 14:24:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Use=20early=20return=20for=20roo?= =?UTF-8?q?tViewController=20in=20openLookAround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com> --- .../Sources/mapkit_flutter/MapView/MapKitViewHost.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/darwin/mapkit_flutter/Sources/mapkit_flutter/MapView/MapKitViewHost.swift b/darwin/mapkit_flutter/Sources/mapkit_flutter/MapView/MapKitViewHost.swift index 539f4b6..f6cebcf 100644 --- a/darwin/mapkit_flutter/Sources/mapkit_flutter/MapView/MapKitViewHost.swift +++ b/darwin/mapkit_flutter/Sources/mapkit_flutter/MapView/MapKitViewHost.swift @@ -170,11 +170,10 @@ public class MapKitViewHost: NSObject, @preconcurrency MapKitHostApi { return } let vc = MKLookAroundViewController(scene: scene) - let host = self.contentView.window?.rootViewController + guard let host = self.contentView.window?.rootViewController ?? UIApplication.shared.connectedScenes - .compactMap { ($0 as? UIWindowScene)?.keyWindow?.rootViewController } - .first - guard let host = host else { + .compactMap({ ($0 as? UIWindowScene)?.keyWindow?.rootViewController }) + .first else { completion(.success(false)) return }