DougSteiert / ResearchApp

GNU General Public License v3.0
1 stars 1 forks source link

Crash on null object reference #4

Closed DougSteiert closed 7 years ago

DougSteiert commented 7 years ago

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.realm.RealmList com.djsg38.locationprivacyapp.models.Session.getRealLocations()' on a null object reference at com.djsg38.locationprivacyapp.MainActivity$4.execute(MainActivity.java:151) at io.realm.Realm.executeTransaction(Realm.java:1254) at com.djsg38.locationprivacyapp.MainActivity.onCreate(MainActivity.java:143)

user404d commented 7 years ago

Fixed as far as I can tell. The issue was tempLoc being set to null and never initialized as a Location of any kind. The fix was to set it to a Location. I also made some other small changes. See changes here. Almost forgot to push this up.