mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user