Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1458 from edx/omer/LEARNER-7917
Browse files Browse the repository at this point in the history
Crash fix of null profile exception on CourseOutlineFragment.java
  • Loading branch information
omerhabib26 authored Sep 10, 2020
2 parents a84bb4c + 52f70aa commit 85d42a9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.edx.mobile.logger.Logger;
import org.edx.mobile.model.api.CourseUpgradeResponse;
import org.edx.mobile.model.api.EnrolledCoursesResponse;
import org.edx.mobile.model.api.ProfileModel;
import org.edx.mobile.model.course.BlockPath;
import org.edx.mobile.model.course.CourseComponent;
import org.edx.mobile.model.course.CourseStructureV1Model;
Expand Down Expand Up @@ -234,11 +235,12 @@ private void trackAATestCourseOutline() {
final FirebaseRemoteConfig firebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
firebaseRemoteConfig.fetchAndActivate().addOnCompleteListener(task -> {
final String group = firebaseRemoteConfig.getString(Analytics.Keys.AA_EXPERIMENT);
if (!TextUtils.isEmpty(group)) {
final ProfileModel profileModel = environment.getLoginPrefs().getCurrentUserProfile();
if (!TextUtils.isEmpty(group) && profileModel != null) {
final Map<String, String> values = new HashMap<>();
values.put(Analytics.Keys.EXPERIMENT, Analytics.Keys.AA_EXPERIMENT);
values.put(Analytics.Keys.GROUP, group);
values.put(Analytics.Keys.USER_ID, environment.getLoginPrefs().getCurrentUserProfile().id.toString());
values.put(Analytics.Keys.USER_ID, profileModel.id.toString());
values.put(Analytics.Keys.COURSE_ID, courseData.getCourse().getId());
environment.getAnalyticsRegistry().trackExperimentParams(Analytics.Events.MOBILE_EXPERIMENT_EVALUATED, values);
}
Expand Down

0 comments on commit 85d42a9

Please sign in to comment.