Kotlin: non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull

项目转为Kotlin,部分代码Java转Kotlin时报错如下   

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter convertView
 

 val tagAdapter = object : TagAdapter() {

                    override fun getView(position: Int, convertView: View, parent: ViewGroup): View {
                        val textView = ColorfulTagView(UIUtils.getContext())
                        textView.text = getItem(position) as String
                        return textView
                    }
                }

这是Kotlin安全机制的检测,需要在方法中加入 ?

Kotlin: non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull_第1张图片

你可能感兴趣的:(安卓错误分析)