Skip to content

Commit

Permalink
Added catched for the NullReferenceException we keep encountering wit…
Browse files Browse the repository at this point in the history
…h browser extensions that should give us more information to work off of.

Also removed an old debug catch that I forgot to take out in the last commit.
  • Loading branch information
XavierNCline committed May 28, 2024
1 parent c069a1c commit c997437
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/data/Methods/System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ await LogEventAsync($"Exception occured in GetBrowserExtension() during Firefox
if (e is FileNotFoundException || e is JsonException)
await LogEventAsync($"Error reading manifest or locale data for {di.Name} in {browser.Name}",
Region.System, EventType.WARNING);

if (e is NullReferenceException)
await LogEventAsync($"Null reference caught reading {di.Name} in {browser.Name}",
Region.System, EventType.WARNING);
}
}
}
Expand Down Expand Up @@ -731,8 +735,9 @@ await LogEventAsync($"Exception occured in GetBrowserExtension() during Firefox
await LogEventAsync($"Error reading manifest or locale data for {di.Name} in {browser.Name}",
Region.System, EventType.WARNING);

if (e is ArgumentOutOfRangeException)
Console.WriteLine("I am here!");
if (e is NullReferenceException)
await LogEventAsync($"Null reference caught reading {di.Name} in {browser.Name}",
Region.System, EventType.WARNING);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions client/data/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ public static Browser.Extension ParseChromiumExtension(string path)
DebugLog.LogEvent($"Chromium extension path invalid: {path}", DebugLog.Region.System, DebugLog.EventType.WARNING);
return null;
}
catch (NullReferenceException e)
{
DebugLog.LogEvent($"Null reference caught reading extension data at {path}", DebugLog.Region.System, DebugLog.EventType.WARNING);
return null;
}
catch (Exception e)
{
DebugLog.LogEvent($"Unexpected exception occured in ParseChromiumExtension: {e}", DebugLog.Region.System, DebugLog.EventType.ERROR);
Expand Down

0 comments on commit c997437

Please sign in to comment.