Skip to content

Commit

Permalink
Added specific verification of class being UIViewController class
Browse files Browse the repository at this point in the history
  • Loading branch information
jeslyvarghese committed Mar 28, 2014
1 parent 6bf4645 commit a1f78d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@ - (NSDictionary*)paramsInRoute:(NSString*)route
}
}
}

if (class_isMetaClass(object_getClass(subRoutes[@"_"]))) {
params[@"controller_class"] = subRoutes[@"_"];
Class class = subRoutes[@"_"];
if (class_isMetaClass(object_getClass(class))) {
if ([class isSubclassOfClass:[UIViewController class]]) {
params[@"controller_class"] = subRoutes[@"_"];
} else {
return nil;
}
} else {
if (subRoutes[@"_"]) {
params[@"block"] = [subRoutes[@"_"] copy];
Expand Down

0 comments on commit a1f78d7

Please sign in to comment.