I have this code in Kotlin in android studio:
result.put(REGISTER_DATE, if (activityData.registerDate == null) -1 else activityData.registerDate.totalDays)
As you can see I check registerDate is not null, but I have to put non-null assert after activityData.registerDate
to eliminate null error:
result.put(REGISTER_DATE, if (activityData.registerDate == null) -1 else activityData.registerDate!!.totalDays)
Is this a bug in Kotlin or is related to Android Studio?