Allow subdescriptors to return nil to signal no data
Summary: Currently subdescriptors are *always* rendered. Allow them to return `nil` to signal that they don't need to be rendered. Reviewed By: cuva Differential Revision: D21157249 fbshipit-source-id: 68a83424efc50723e1ec71c069feef8e10037671
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d0803ecd56
commit
d66484822b
@@ -102,7 +102,10 @@ static std::vector<std::pair<NSString*, SKSubDescriptor>>& subDescriptors() {
|
||||
[[NSMutableDictionary alloc] init];
|
||||
|
||||
for (const auto& pair : subDescriptors()) {
|
||||
[extraData setObject:pair.second(node) forKey:pair.first];
|
||||
NSString* value = pair.second(node);
|
||||
if (value) {
|
||||
[extraData setObject:value forKey:pair.first];
|
||||
}
|
||||
}
|
||||
if (extraData.count > 0) {
|
||||
[data addObject:[SKNamed newWithName:@"Extra Sections"
|
||||
|
||||
Reference in New Issue
Block a user