     
     func getFiles()
     {
-        if !(viewModel?.isLoggedIn)!
-        {
+        if let viewModel = viewModel, !viewModel.isLoggedIn
+        {
+            showNotLoggedInMessage()
             tableView.mj_header.endRefreshing()
             return
         }

        switch error.errorType
        {
        case .cancelledLoginToDrive, .couldNotLoginToDrive, .notLoggedInToDrive:
            loginButtonTapped(UIBarButtonItem())
            return
            
        case .loggedInToToDrive:
            message.buttonTapHandler =

    override func viewWillAppear(_ animated: Bool)
    {
        super.viewWillAppear(animated)
        showNotLoggedInMessage()
    }
    
    func showNotLoggedInMessage()
    {
        guard let viewModel = viewModel, !viewModel.isLoggedIn else { return }
        let errorMessage = YSError(errorType: YSErrorType.notLoggedInToDrive, messageType: Theme.warning, title: "Warning", message: "Could not get list, please login", buttonTitle: "Login", debugInfo: "")
        errorDidChange(viewModel: viewModel, error: errorMessage)
    }
    
    func deleteToolbarButtonTapped(_ sender: UIBarButtonItem)
