Skip to content

BHRouter canOpenURL 校验时错误 #133

@zevwings

Description

@zevwings

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

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

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

建议添加一行过滤代码

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions