刚刚开始使用Kotlin进行Android开发.我的arraylist声明如下-
var day1: ArrayList<DietPlanDetailModel>? = null
现在我试图通过元素的位置来访问它
val dietPlan= day1[position]
但我的编译时错误率正在下降-
Only safe or non null assserted calls are allowed on a nullable receiver type of arraylist
Why am i getting this error and how can i resolve it?