Skip to content

Commit

Permalink
Update HHRouter.m
Browse files Browse the repository at this point in the history
even if params is nil, 
[params[@"block"] copy] will return a non nil value.
  • Loading branch information
akash-mudubagilu committed Dec 18, 2015
1 parent 906a0aa commit 213aa4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ - (UIViewController *)match:(NSString *)route
- (HHRouterBlock)matchBlock:(NSString *)route
{
NSDictionary *params = [self paramsInRoute:route];

if (!params){
return nil;
}

HHRouterBlock routerBlock = [params[@"block"] copy];
HHRouterBlock returnBlock = ^id(NSDictionary *aParams) {
if (routerBlock) {
Expand Down

0 comments on commit 213aa4d

Please sign in to comment.