frankvHoof93 / TikTokLiveSharp

Port of TikTok live library for C#
https://vanhoof.dev
Other
140 stars 28 forks source link

System.NullReferenceException: 'Object reference not set to an instance of an object.' #26

Closed minhiclick closed 7 months ago

minhiclick commented 10 months ago

public void Run(CancellationToken? cancellationToken = null, Action onConnectException = null, bool retryConnection = false) { token = cancellationToken ?? new CancellationToken(); token.ThrowIfCancellationRequested(); if (ShouldLog(LogLevel.Information)) Debug.Log("Starting Threads"); var run = Task.Run(() => Start(token, null, retryConnection), token); run.Wait(); runningTask.Wait(); <--- System.NullReferenceException: 'Object reference not set to an instance of an object.' pollingTask.Wait(); }

frankvHoof93 commented 10 months ago

Task.Run should always return a Task to be awaited. Can you provide more info as to what you're running this on, etc.?

minhiclick commented 10 months ago

The problem happens sometimes (maybe when too many people are streaming on TikTok). For example right now. With the nickname: moment.house. Live link: @.***/live.

On Sat, Aug 12, 2023 at 5:38 PM Frank van Hoof @.***> wrote:

Task.Run should always return a Task to be awaited. Can you provide more info as to what you're running this on, etc.?

— Reply to this email directly, view it on GitHub https://github.com/frankvHoof93/TikTokLiveSharp/issues/26#issuecomment-1675841187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALETNQZIGU465UTOTYL7TBTXU5MKXANCNFSM6AAAAAA3NYQHCA . You are receiving this because you authored the thread.Message ID: @.***>

-- Ngô Hoàng Minh Quản lý iClick

minhiclick commented 10 months ago

Task.Run should always return a Task to be awaited. Can you provide more info as to what you're running this on, etc.?

I'm sorry. I pointed wrong line. image

xiaoqdu commented 8 months ago

the same problem. image

frankvHoof93 commented 8 months ago

Any other logs or exceptions aside from this nullref? Start() should be starting both the running- & pollingTasks. Unless some other error is preventing the lib from starting?

frankvHoof93 commented 8 months ago

Please let me know if the issue persists in V1.0.0.

frankvHoof93 commented 7 months ago

Closed for inactivity