diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 919d643..6a7177b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -416,11 +416,15 @@ public class DeviceProxyService { @SneakyThrows public void pullLiveStream2Rtp(SIPRequest request,Runnable sendOkResponse,String callId, MockingDevice device, String rtpAddr, int rtpPort, String ssrc){ String liveCacheKey = CacheUtil.getKey("INVITE", "LIVE", device.getGbDeviceId()); - String liveCache = RedisUtil.StringOps.get(liveCacheKey); - RedisUtil.KeyOps.delete(liveCache); - - // 关闭已存在的实时流 bye 订阅(如果存在) - subscribe.getByeSubscribe().delPublisher(liveCache); + String liveCache; + if(liveCacheKey != null){ + liveCache = RedisUtil.StringOps.get(liveCacheKey); + if(liveCache != null){ + RedisUtil.KeyOps.delete(liveCache); + // 关闭已存在的实时流 bye 订阅(如果存在) + subscribe.getByeSubscribe().delPublisher(liveCache); + } + } ScheduledFuture schedule = trying(request); Retryer> retryer = RetryerBuilder.>newBuilder()