fix: 修复空指针和类型转换问题

pull/735/head
kunlong-luo 2023-02-02 14:36:19 +08:00
parent 166272ad11
commit 8f2ce95165
1 changed files with 5 additions and 1 deletions

View File

@ -228,7 +228,11 @@ public class MediaServerServiceImpl implements IMediaServerService {
String onlineKey = VideoManagerConstants.MEDIA_SERVERS_ONLINE_PREFIX + userSetting.getServerId(); String onlineKey = VideoManagerConstants.MEDIA_SERVERS_ONLINE_PREFIX + userSetting.getServerId();
for (Object mediaServerKey : mediaServerKeys) { for (Object mediaServerKey : mediaServerKeys) {
String key = (String) mediaServerKey; String key = (String) mediaServerKey;
MediaServerItem mediaServerItem = (MediaServerItem) RedisUtil.get(key); JSONObject jsonObject = (JSONObject) RedisUtil.get(key);
if (Objects.isNull(jsonObject)) {
continue;
}
MediaServerItem mediaServerItem = JSON.parseObject(jsonObject.toJSONString(), MediaServerItem.class);
// 检查状态 // 检查状态
Double aDouble = RedisUtil.zScore(onlineKey, mediaServerItem.getId()); Double aDouble = RedisUtil.zScore(onlineKey, mediaServerItem.getId());
if (aDouble != null) { if (aDouble != null) {