Fixed NPE - Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Thread.interrupt()" because "this.liveDownloadThread" is null

Moved websocketClient.setSocketFactory call up where it only needs called once not looped. Also added pingingTask.run for not used proxy connections.
This commit is contained in:
kohlerpop1
2024-01-21 13:00:49 -05:00
parent a0ac9e6d79
commit 283024a1d4
4 changed files with 29 additions and 37 deletions

View File

@@ -128,12 +128,14 @@ public class RecorderListener implements LiveRecorder {
@TikTokEventObserver
private void onDisconnected(LiveClient liveClient, TikTokDisconnectedEvent event) {
liveDownloadThread.interrupt();
if (isConnected())
liveDownloadThread.interrupt();
}
@TikTokEventObserver
private void onDisconnected(LiveClient liveClient, TikTokLiveEndedEvent event) {
liveDownloadThread.interrupt();
if (isConnected())
liveDownloadThread.interrupt();
}
private int terminateFfmpeg(final Process process) {
@@ -194,4 +196,8 @@ public class RecorderListener implements LiveRecorder {
return new DownloadData(urlLink, sessionId);
}
private boolean isConnected() {
return liveDownloadThread != null && liveDownloadThread.isAlive();
}
}