Merge pull request #735 from kunlong-luo/fix-host-bug

fix: 修复空指针和类型转换问题
pull/736/head
648540858 2023-02-02 15:11:33 +08:00 committed by GitHub
commit 192f012829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {