stepic user could be null

This commit is contained in:
Ekaterina Tuzova
2016-12-19 12:29:57 +03:00
parent f83f867cbd
commit a853ec4635
@@ -45,7 +45,7 @@ public class EduStepicConnector {
}
public static boolean enrollToCourse(final int courseId, final StepicUser stepicUser) {
if (stepicUser != null && stepicUser.getAccessToken() == null) return false;
if (stepicUser == null || stepicUser.getAccessToken() == null) return false;
HttpPost post = new HttpPost(EduStepicNames.STEPIC_API_URL + EduStepicNames.ENROLLMENTS);
try {
final StepicWrappers.EnrollmentWrapper enrollment = new StepicWrappers.EnrollmentWrapper(String.valueOf(courseId));