| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Added a nil check before calling setNeedsStatusBarAppearanceUpdate on rootViewController to prevent potential crashes when rootViewController is not set.
There was a problem hiding this comment.
This PR adds defensive nil checks for rootViewController to prevent crashes when SVProgressHUD attempts to add its view to windows or update status bar appearance during app state transitions.
Key Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
…ore adding to window
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #1157
Adds a nil check for rootViewController before adding the control view to the window in updateViewHierarchy.
Problem
When SVProgressHUD is shown, it adds its control view to the front window. If the window exists but has no rootViewController (or it's in an invalid state during app transitions), UIKit throws an NSInternalInconsistencyException when resolving trait collection for the new subview.
Solution
Check that window.rootViewController is not nil before adding the subview:
Testing