[Solved] Android – java Cloud Firestore : NullPointerException when converting data toObject [duplicate]


The UserSettings class has a constructor that looks like this:

public UserSettings(ArrayList<User> mUser, ArrayList<UserAccountSettings> mSettings){

}

This constructor doesn’t set the user and settings variables defined in this class and it is the constructor you use to create the return value of the getUserSettings method.

return new UserSettings(mUser, mSettings ); // `mUser` and `mSettings` are `ArrayList`s

Hence the exception.

This is the main problem, the one that generates the exception you’ve mentioned but it is not the only problem.

2

solved Android – java Cloud Firestore : NullPointerException when converting data toObject [duplicate]