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

Kotlin 参数注入不支持 NULL 作为默认值 #814

Open
yubaokang opened this issue Apr 27, 2020 · 4 comments
Open

Kotlin 参数注入不支持 NULL 作为默认值 #814

yubaokang opened this issue Apr 27, 2020 · 4 comments
Labels

Comments

@yubaokang
Copy link

No description provided.

@yubaokang
Copy link
Author

遇到很奇怪的问题:
用以下代码,第二次跳转的时候,影响到了所有的参数,都取不到值
@JvmField
@Autowired(required = false, desc = "接听电话 房间id")
var roomId: Int? = null

如果改成String类型就没问题
@JvmField
@Autowired(required = false, desc = "接听电话 房间id")
var roomId: String? = null

@EthanCo
Copy link

EthanCo commented Aug 25, 2020

我也遇到了这个问题,终于找到原因了。
详见 https://blog.csdn.net/EthanCo/article/details/108225497
大佬也可以关注下这个问题,修复下 @zhi1ong

@zhi1ong
Copy link
Member

zhi1ong commented Oct 20, 2020

是个 bug,1.5.1 修复

@zhi1ong zhi1ong closed this as completed Oct 20, 2020
@zhi1ong zhi1ong added the bug label Oct 20, 2020
@zhi1ong
Copy link
Member

zhi1ong commented Oct 20, 2020

暂时 Kotlin 环境注入的时候,参数必须要有默认值,且不能是 null

@zhi1ong zhi1ong reopened this Oct 20, 2020
@zhi1ong zhi1ong changed the title 第二次跳转传值穿不过去 Kotlin 参数注入不支持 NULL 作为默认值 Oct 26, 2020
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