1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-15 06:53:17 +00:00

fix for crash when terminating app (#1589)

This commit is contained in:
Matt Portune
2021-10-16 07:56:17 -04:00
committed by Matt Portune
parent 1b93131a1f
commit c2657cf93e

View File

@@ -188,6 +188,12 @@ namespace Bit.iOS
_storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
_messagingService.Send("slept");
if (UIApplication.SharedApplication.KeyWindow == null)
{
// Despite IDE warning, KeyWindow is null here during app termination in iOS 15
return;
}
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
{
Tag = 4321