Skip to content

Commit

Permalink
Fix potential crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jsidewhite committed Apr 17, 2024
1 parent a865dd8 commit c206586
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,28 @@ await Task.Run(async () =>
return;
}

var isFeaturePresent = QuietBackgroundProcessesSessionManager.IsFeaturePresent();
var isFeaturePresent = false;
try
{
isFeaturePresent = QuietBackgroundProcessesSessionManager.IsFeaturePresent();
}
catch (Exception ex)
{
_log.Error(ex, "COM error");
}

var isAvailable = false;
isAvailable = _table != null;
if (!isAvailable)
{
isAvailable = QuietBackgroundProcessesSessionManager.HasLastPerformanceRecording();
try
{
isAvailable = QuietBackgroundProcessesSessionManager.HasLastPerformanceRecording();
}
catch (Exception ex)
{
_log.Error(ex, "COM error");
}
}

var running = false;
Expand Down

0 comments on commit c206586

Please sign in to comment.