From 5e43a02ffacb86df137e6ec1a910815f563fbc39 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sun, 25 Apr 2010 15:42:38 -0700 Subject: [PATCH] Fix some faulty validation logic. --- AppKit/CPToolbarItem.j | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/AppKit/CPToolbarItem.j b/AppKit/CPToolbarItem.j index 57e33cdfc..e5148576e 100644 --- a/AppKit/CPToolbarItem.j +++ b/AppKit/CPToolbarItem.j @@ -449,6 +449,9 @@ CPToolbarItemVisibilityPriorityUser - (void)validate { + var action = [self action], + target = [self target]; + // View items do not do any target-action analysis. if (_view) { @@ -458,13 +461,9 @@ CPToolbarItemVisibilityPriorityUser return; } - var action = [self action]; - if (!action) return [self setEnabled:NO]; - var target = [self target]; - if (target && ![target respondsToSelector:action]) return [self setEnabled:NO];