Skip to content

Commit 06694b5

Browse files
committed
fixing inifinite recursion on Tests with an Host Application where the first window is a ToastWindow itself
1 parent 1f59d79 commit 06694b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/ToastWindow.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ open class ToastWindow: UIWindow {
5353
override open var rootViewController: UIViewController? {
5454
get {
5555
guard !self.isStatusBarOrientationChanging else { return nil }
56-
return UIApplication.shared.windows.first?.rootViewController
56+
guard let firstWindow = UIApplication.shared.windows.first else { return nil }
57+
return firstWindow is ToastWindow ? nil : firstWindow.rootViewController
5758
}
5859
set { /* Do nothing */ }
5960
}

0 commit comments

Comments
 (0)