From c4425e50e3cf65cba0afe2a5072c962ab860805a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 10 Feb 2020 22:42:43 -0500 Subject: [PATCH] Disallow refreshing when there is no query VC --- MongoView/View Controllers/DatabaseViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MongoView/View Controllers/DatabaseViewController.swift b/MongoView/View Controllers/DatabaseViewController.swift index 2c0c3bc..69d38a1 100644 --- a/MongoView/View Controllers/DatabaseViewController.swift +++ b/MongoView/View Controllers/DatabaseViewController.swift @@ -160,7 +160,7 @@ class DatabaseViewController: NSViewController { extension DatabaseViewController: NSMenuItemValidation { func validateMenuItem(_ menuItem: NSMenuItem) -> Bool { - if menuItem.action == #selector(runQuery(_:)) { + if menuItem.action == #selector(runQuery(_:)) || menuItem.action == #selector(refresh(_:)) { return queryViewController != nil } return true