Skip to content

Commit

Permalink
Cbrelease 4.0.1 rc3 null fix (#29)
Browse files Browse the repository at this point in the history
* Handle null pointer for enroll API
  • Loading branch information
ManthanSharma94 authored Feb 16, 2023
1 parent 301689b commit 7c53658
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,19 @@ class CourseEnrolmentActor @Inject()(@Named("course-batch-notification-actor") c

def upsertEnrollment(userId: String, courseId: String, batchId: String, data: java.util.Map[String, AnyRef], isNew: Boolean, requestContext: RequestContext): Unit = {
val dataMap = CassandraUtil.changeCassandraColumnMapping(data)
// code for find root cause of null value in prod(16-02-2023)
try {
val activeStatus = dataMap.get(JsonKey.ACTIVE);
logger.info(requestContext, "upsertEnrollment :: IsNew :: " + isNew + " ActiveStatus :: " + activeStatus + " DataMap is :: " + dataMap)
if (activeStatus == null) {
throw new Exception("Active Value is null in upsertEnrollment");
}
} catch {
case e: Exception =>
logger.error(requestContext, "Exception in upsertEnrollment list : user ::" + userId + "| Exception is:" + e.getMessage, e)
throw e;
}
// END
if(isNew) {
userCoursesDao.insertV2(requestContext, dataMap)
} else {
Expand Down

0 comments on commit 7c53658

Please sign in to comment.