File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -128,26 +128,30 @@ + (NSArray *)getNameComponents:(NSString *)name
128128
129129+ (id )traverse : (id )collection withKey : (id )key autoInsert : (BOOL )autoInsert
130130{
131+ id result = nil ;
131132 if ([collection respondsToSelector: @selector (objectForKey: )]) {
132- id result = [collection objectForKey: key];
133+ result = [collection objectForKey: key];
133134 if (autoInsert && !result && [key isKindOfClass: NSString .class]) {
134135 result = [NSMutableDictionary dictionary ];
135136 [collection setObject: result forKey: key];
136137 }
137- return result;
138138 } else if ([collection isKindOfClass: [NSArray class ]]) {
139139 int index = [key intValue ];
140140 NSArray *arrayCollection = collection;
141141 if (arrayCollection.count > index) {
142- id result = arrayCollection[index];
142+ result = arrayCollection[index];
143143 if (autoInsert && !result && [key isKindOfClass: NSString .class]) {
144144 result = [NSMutableArray array ];
145145 [collection setObject: result atIndex: index];
146146 }
147- return result;
148147 }
149148 }
150- return nil ;
149+
150+ if ([result isKindOfClass: [NSNull class ]]) {
151+ return nil ;
152+ }
153+
154+ return result;
151155}
152156
153157+ (void )registerFile : (NSString *)stringValue withDefaultValue : (NSString *)defaultValue
You can’t perform that action at this time.
0 commit comments