diff --git a/AppKit/Cib/CPCib.j b/AppKit/Cib/CPCib.j index a56b77897..12c9611af 100644 --- a/AppKit/Cib/CPCib.j +++ b/AppKit/Cib/CPCib.j @@ -165,7 +165,14 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey"; - (BOOL)instantiateCibWithOwner:(id)anOwner topLevelObjects:(CPArray)topLevelObjects { - return [self instantiateCibWithExternalNameTable:@{ CPCibOwner: anOwner, CPCibTopLevelObjects: topLevelObjects }]; + // anOwner can be nil, and we can't store nil in a dictionary. If we leave it out, + // anyone who asks for CPCibOwner will get nil back. + var nameTable = @{ CPCibTopLevelObjects: topLevelObjects }; + + if (anOwner) + [nameTable setObject:anOwner forKey:CPCibOwner]; + + return [self instantiateCibWithExternalNameTable:nameTable]; } @end