Fix for -nextValidKeyView infinitely looping when no next valid key view.

Closes #1049.

Reviewed by me.
This commit is contained in:
David K. Hess authored and Francisco Ryan Tolmasky I committed 2010-12-27 03:17:52 -08:00
1 parent b3e0c4a5d5
commit 2d46fb885d
1 file changed
+8 -1
+8 -1
View File
@@ -2145,11 +2145,18 @@ setBoundsOrigin:
- (CPView)nextValidKeyView
{
var result = [self nextKeyView];
var result = [self nextKeyView],
firstResult = result;
while (result && ![result canBecomeKeyView])
{
result = [result nextKeyView];
// Cycled.
if (result === firstResult)
return nil;
}
return result;
}