Why do I keep getting this null pointer exception android app kotlin
My app was working fine, then all of a sudden, I started getting these null pointer errors. For some reason the alarm object is not being retrieved by the code.
var alarm = alarmRepository.getAlarm(intentAlarmId.toLong())
I have no idea why. Even if I replace intentAlarmId.toLong() with a 1, it will still not retrieve it. So it is not that. It takes an intent extra containing the alarm id, and gets it from the room database. I have narrowed it down to the alarm object being null. I just don't...