mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-22 10:07:37 +00:00
explicit null check for JsonSerializer.Deserialize
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
0fb833d8b0
commit
48a84502ec
@ -107,7 +107,7 @@ namespace PowerAccent.Core.Tools
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var json = File.ReadAllText(_filePath);
|
var json = File.ReadAllText(_filePath);
|
||||||
return JsonSerializer.Deserialize(json, SourceGenerationContext.Default.UsageInfoData);
|
return JsonSerializer.Deserialize(json, SourceGenerationContext.Default.UsageInfoData) ?? new UsageInfoData();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user