错误代码:

for(Map<String,Object> videoItemMap:learnVideoList){
  String videoStuId=MapUtils.getString(videoItemMap, "record_user_id");
  if(videoStuId==stuId){
    videoCostTime=MapUtils.getInteger(videoItemMap, "videoTime");
    break;
  }
}

请求进程错误,空指针错误,报空指针异常。紧跟的是错误代码的位置。

threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at com.ho.pc.service.impl.ClManager.getDailyS(ClManager.java:115)

经检查:该行代码中使用了值为null的List<Map<String,Object>> 型变量learnVideoList 。因此遍历之前,需要判null!!!

PS:为毛.NET没遇到过这类情况。。。

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2021-04-19
  • 2021-11-29
  • 2021-11-16
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2021-10-03
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案