Skip to content

Commit baae6f2

Browse files
committed
add try catch around SetProgressValue/SetProgressState calls
1 parent acfd930 commit baae6f2

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

FlashpointSecurePlayer/ProgressManager.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ private static ProgressBarStyle ProgressFormStyle {
531531
return;
532532
}
533533

534-
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
534+
try {
535+
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
536+
} catch (Exception ex) {
537+
LogExceptionToLauncher(ex);
538+
}
535539
}
536540
}
537541

@@ -583,11 +587,19 @@ private static int ProgressFormValue {
583587
return;
584588
}
585589

586-
taskbarList.SetProgressValue(ProgressForm.Handle, ProgressManager.progressFormValue, PROGRESS_FORM_VALUE_COMPLETE);
590+
try {
591+
taskbarList.SetProgressValue(ProgressForm.Handle, ProgressManager.progressFormValue, PROGRESS_FORM_VALUE_COMPLETE);
592+
} catch (Exception ex) {
593+
LogExceptionToLauncher(ex);
594+
}
587595

588596
// it is required to enter no progress state when completed
589597
if (completed) {
590-
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
598+
try {
599+
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
600+
} catch (Exception ex) {
601+
LogExceptionToLauncher(ex);
602+
}
591603
return;
592604
}
593605

@@ -660,7 +672,11 @@ private static IntPtr ProgressFormState {
660672
return;
661673
}
662674

663-
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
675+
try {
676+
taskbarList.SetProgressState(ProgressForm.Handle, ProgressManager.progressFormState);
677+
} catch (Exception ex) {
678+
LogExceptionToLauncher(ex);
679+
}
664680
}
665681
}
666682

0 commit comments

Comments
 (0)