explicit null check for JsonSerializer.Deserialize
Some checks failed
Spell checking / Check Spelling (push) Has been cancelled
Spell checking / Update PR (push) Has been cancelled
Spell checking / Report (Push) (push) Has been cancelled
Spell checking / Report (PR) (push) Has been cancelled

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Gleb Khmyznikov
2025-08-21 15:02:41 +02:00
committed by GitHub
parent 0fb833d8b0
commit 48a84502ec

View File

@@ -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)
{ {