BeeHive icon indicating copy to clipboard operation
BeeHive copied to clipboard

BHRouter canOpenURL 校验时错误

Open zevwings opened this issue 5 years ago • 0 comments

BHRouter 调用canOpenURL 时,使用URL.pathComponents获得的pathComponents会存在/,直接导致校验pathComponentKey是否为Class时,提前退出。

判断代码,当pathComponentKey/会报错。

Class mClass = NSClassFromString(pathComponentKey);
if (!mClass) {
     flag = NO;
     *stop = NO;
     return;
}

建议添加一行过滤代码

if ([pathComponentKey isEqualToString:@"/"]) {
      return;
}

zevwings avatar Mar 21 '19 07:03 zevwings