cappuccino/cappuccino — pull request #1987 by mrcarlberg (2013-09-13 09:07:09+00:00)
Title: 'valueForKeyPath:' method in CPObjectController returns 'null marker' instead of nil

CPObjectController will return 'null marker' instead of nil when 'myAttribute' is nil in the following code:
```Objective-C
[objectController valueForKeyPath:@"selection.myAttribute"]
```

The class '_CPControllerObjectProxy' returns the 'null marker' but it does not do it in Cocoa. I have a hard time figuring out how to solve this. I have only done the test case. Any help in doing this should be highly appreciated.

This might be related to #1986.

Here is a corresponding working test case for Objective-C:
```Objective-C
- (void)testObjectControllerSelectionWithNil
{
NSObjectController *controller = [[NSObjectController alloc] init];
[controller setContent:@{@"name": @"Martin"}];
STAssertEqualObjects([[controller selection] valueForKeyPath:@"name"], @"Martin", @"name equals 'Martin'");
STAssertEqualObjects([[controller selection] valueForKeyPath:@"lastName"], nil, @"name equals 'nil'");
STAssertEqualObjects([controller valueForKeyPath:@"selection.name"], @"Martin", @"selection.name equals 'Martin'");
STAssertEqualObjects([controller valueForKeyPath:@"selection.lastName"], nil, @"selection.name equals 'nil'");
}
```