Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when sending window message to UIApplicationDelegate #311

Open
MrMage opened this issue Oct 11, 2017 · 0 comments
Open

Crash when sending window message to UIApplicationDelegate #311

MrMage opened this issue Oct 11, 2017 · 0 comments

Comments

@MrMage
Copy link

MrMage commented Oct 11, 2017

Line 857 of iRate.m currently contains this code:

UIViewController *topController = [UIApplication sharedApplication].delegate.window.rootViewController;

However, the window property of the UIApplicationDelegate is declared as optional. Thus, the above code leads to a crash when my application delegate does not implement the window method.

I suggest checking for existence of that method via -respondsToSelector: first and using [UIApplication sharedApplication].keyWindow otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant