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:
Adam Ernst
2020-04-21 11:51:02 -07:00
committed by Facebook GitHub Bot
parent d0803ecd56
commit d66484822b

View File

@@ -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"