mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
Added null checks for iOS crash OnActivated on KeyWindow (#1856)
This commit is contained in:
parent
fdcb2d76c9
commit
840925c479
1 changed files with 6 additions and 6 deletions
|
@ -24,6 +24,8 @@ namespace Bit.iOS
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public partial class AppDelegate : FormsApplicationDelegate
|
public partial class AppDelegate : FormsApplicationDelegate
|
||||||
{
|
{
|
||||||
|
const int SPLASH_VIEW_TAG = 4321;
|
||||||
|
|
||||||
private NFCNdefReaderSession _nfcSession = null;
|
private NFCNdefReaderSession _nfcSession = null;
|
||||||
private iOSPushNotificationHandler _pushHandler = null;
|
private iOSPushNotificationHandler _pushHandler = null;
|
||||||
private Core.NFCReaderDelegate _nfcDelegate = null;
|
private Core.NFCReaderDelegate _nfcDelegate = null;
|
||||||
|
@ -175,7 +177,7 @@ namespace Bit.iOS
|
||||||
{
|
{
|
||||||
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
||||||
{
|
{
|
||||||
Tag = 4321
|
Tag = SPLASH_VIEW_TAG
|
||||||
};
|
};
|
||||||
var backgroundView = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
var backgroundView = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
||||||
{
|
{
|
||||||
|
@ -205,11 +207,9 @@ namespace Bit.iOS
|
||||||
{
|
{
|
||||||
base.OnActivated(uiApplication);
|
base.OnActivated(uiApplication);
|
||||||
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
||||||
var view = UIApplication.SharedApplication.KeyWindow.ViewWithTag(4321);
|
UIApplication.SharedApplication.KeyWindow?
|
||||||
if (view != null)
|
.ViewWithTag(SPLASH_VIEW_TAG)?
|
||||||
{
|
.RemoveFromSuperview();
|
||||||
view.RemoveFromSuperview();
|
|
||||||
}
|
|
||||||
|
|
||||||
ThemeManager.UpdateThemeOnPagesAsync();
|
ThemeManager.UpdateThemeOnPagesAsync();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue