Fix crash that can happen if updateUI is called before the UI is fully setup

This commit is contained in:
Maurice Parker 2019-10-30 04:04:13 -05:00
parent 2a39ada5ab
commit 42f4332023
1 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ import RSTree
class MasterFeedViewController: UITableViewController, UndoableCommandRunner { class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
private var refreshProgressView: RefreshProgressView! private var refreshProgressView: RefreshProgressView?
private var addNewItemButton: UIBarButtonItem! private var addNewItemButton: UIBarButtonItem!
private lazy var dataSource = makeDataSource() private lazy var dataSource = makeDataSource()
@ -572,8 +572,8 @@ private extension MasterFeedViewController {
} }
func updateUI() { func updateUI() {
refreshProgressView.updateRefreshLabel() refreshProgressView?.updateRefreshLabel()
addNewItemButton.isEnabled = !AccountManager.shared.activeAccounts.isEmpty addNewItemButton?.isEnabled = !AccountManager.shared.activeAccounts.isEmpty
} }
func reloadNode(_ node: Node) { func reloadNode(_ node: Node) {