Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmui_queryItems 返回值类型错误会导致swift中调用崩溃 #1391

Closed
xixisplit opened this issue Apr 15, 2022 · 4 comments
Closed

qmui_queryItems 返回值类型错误会导致swift中调用崩溃 #1391

xixisplit opened this issue Apr 15, 2022 · 4 comments
Labels

Comments

@xixisplit
Copy link
Contributor

Bug 表现
问题的具体描述
NSURL (QMUI) 文件中
qmui_queryItems 参数的指定返回值类型为 (NSDictionary<NSString *, NSString *> *)
但是.30行的 [params setObject:obj.value ?: [NSNull null] forKey:obj.name] 中.obj.value 如果为空.则会赋值 NSNull
会触发swift 中对参数类型的强制校验.引发崩溃.
控制台提示:
Could not cast value of type 'NSNull' (0x2076dbeb8) to 'NSString' (0x2076d8e30).

截图
Bug 现场的界面截图,或者 Xcode 控制台的错误信息截图,有问题的代码截图
如何重现
let url = NSURL.init(string: "https://www.baidu.com?key")
debugPrint(url?.qmui_queryItems)
swift 项目 直接调用以上代码即可

预期的表现
正常情况下,应该是什么表现

其他信息

  • 设备: [iPhone SE2]
  • iOS 版本: [iOS 15.4.1]
  • Xcode 版本: [Xcode 13.2.1]
  • QMUI 版本: [4.4.0]
@MoLice MoLice added the bug label Apr 16, 2022
@MoLice
Copy link
Collaborator

MoLice commented Apr 16, 2022

感谢指出,下个版本会修复,在此之前请将本地代码改为:

[params setObject:obj.value ?: @"" forKey:obj.name];

@BinBear
Copy link

BinBear commented Apr 17, 2022

下个版本有发布计划吗

@MoLice
Copy link
Collaborator

MoLice commented Apr 17, 2022

近期暂无大版本,小版本如果需要的话可以两周内发一个。

@MoLice
Copy link
Collaborator

MoLice commented Aug 10, 2022

已发布 4.5.0 修复该问题。

@MoLice MoLice closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants