Skip to content

Commit

Permalink
Fix app crash when fetching videos in vod/clip mass downloaders
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Aug 27, 2024
1 parent d54ae22 commit 74273ad
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions TwitchDownloaderWPF/WindowMassDownload.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ private async Task UpdateList()
{
currentCursor = cursorList[cursorIndex];
}
GqlVideoSearchResponse res = await TwitchHelper.GetGqlVideos(currentChannel, currentCursor, videoCount);

GqlVideoSearchResponse res;
try
{
res = await TwitchHelper.GetGqlVideos(currentChannel, currentCursor, videoCount);
}
catch (Exception ex)
{
if (Settings.Default.VerboseErrors)
{
MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error);
}

return;
}

videoList.Clear();
if (res.data.user != null)
{
Expand Down Expand Up @@ -125,7 +140,22 @@ private async Task UpdateList()
{
currentCursor = cursorList[cursorIndex];
}
GqlClipSearchResponse res = await TwitchHelper.GetGqlClips(currentChannel, period, currentCursor, videoCount);

GqlClipSearchResponse res;
try
{
res = await TwitchHelper.GetGqlClips(currentChannel, period, currentCursor, videoCount);
}
catch (Exception ex)
{
if (Settings.Default.VerboseErrors)
{
MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error);
}

return;
}

videoList.Clear();
if (res.data.user != null)
{
Expand Down

0 comments on commit 74273ad

Please sign in to comment.