     // At startup, the extension may show an alert that it can't share. In this case for a better UI, rather than showing
     // 2 popup dialogs (the main one and then the alert), just show the alert.
     func hidePopupWhenShowingAlert() {
-        embedController.navigationController.view.alpha = 0
+        embedController?.navigationController.view.alpha = 0
     }
 }
 


@objc(InitialViewController)
class InitialViewController: UIViewController {
    var embedController: EmbeddedNavController!
    var shareViewController: ShareViewController!

    override func viewDidLoad() {
        UIDevice.current.beginGeneratingDeviceOrientationNotifications()


        getShareItem().uponQueue(.main) { shareItem in
            guard let shareItem = shareItem else {
                let alert = UIAlertController(title: Strings.SendToErrorTitle, message: Strings.SendToErrorMessage, preferredStyle: .alert)
                alert.addAction(UIAlertAction(title: Strings.SendToErrorOKButton, style: .default) { _ in self.finish(afterDelay: 0) })
                self.present(alert, animated: true, completion: nil)
