From 588da9addb59ad897feaf81c15a6505220f42e3c Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 21 Dec 2012 16:44:35 +0000 Subject: [PATCH] Fixed: token field access of DOM in non-DOM apps. Without this fix, the internal [tokenField _editorValue] would check the DOM input element even if !PLATFORM(DOM), which could potentially crash unit tests and future non DOM implementations. The fix returns an empty string for non-DOM platforms. --- AppKit/CPTokenField.j | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AppKit/CPTokenField.j b/AppKit/CPTokenField.j index e333e3a59..cc19b24e5 100755 --- a/AppKit/CPTokenField.j +++ b/AppKit/CPTokenField.j @@ -706,7 +706,11 @@ var CPScrollDestinationNone = 0, { if (![self hasThemeState:CPThemeStateEditing]) return @""; +#if PLATFORM(DOM) return [self _inputElement].value; +#else + return @""; +#endif } - (void)moveUp:(id)sender