进入会议报temp空指针异常

来源:1-1 课程导学 :SpringBoot 在线协同办公小程序开发

莉莉周想喝奶茶

2021-04-19

错误:java.lang.NullPointerException: Cannot invoke “Object.toString()” because “temp” is null
at com.example.emos.wx.service.impl.MeetingServiceImpl.searchRoomIdByUUID(MeetingServiceImpl.java:200)
at com.example.emos.wx.controller.MeetingController.searchRoomIdByUUID(MeetingController.java:147)
at com.example.emos.wx.controller.MeetingControllerFastClassBySpringCGLIBFastClassBySpringCGLIBFastClassBySpringCGLIBabe39e21.invoke()

报错的代码

public Long searchRoomIdByUUID(String uuid) {
    Object temp = redisTemplate.opsForValue().get(uuid);
    long roomId = Long.parseLong(temp.toString());
    return roomId;
}
写回答

1回答

神思者

2021-04-19

你到会议相关的章节提问,你把问题放在导学章节并不合适,新同学看到你的问题不知所以

0
1
精慕门8147235
老师我也有这个问题
2023-06-28
共1条回复

SpringBoot 在线协同办公小程序开发 全栈式项目实战

未来趋势型业务 + 前后端综合技术栈 + 惊艳的细节打磨

1798 学习 · 1915 问题

查看课程