mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
null enhance
This commit is contained in:
@@ -49,20 +49,25 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
LoadDefault();
|
||||
}
|
||||
return _data;
|
||||
return _data.NonNull();
|
||||
}
|
||||
|
||||
private void Deserialize(string searlized)
|
||||
{
|
||||
try
|
||||
{
|
||||
_data = JsonConvert.DeserializeObject<T>(searlized, _serializerSettings).NonNull();
|
||||
_data = JsonConvert.DeserializeObject<T>(searlized, _serializerSettings);
|
||||
}
|
||||
catch (JsonSerializationException e)
|
||||
{
|
||||
LoadDefault();
|
||||
Log.Exception($"|JsonStrorage.Deserialize|Deserialize error for json <{FilePath}>", e);
|
||||
}
|
||||
|
||||
if (_data == null)
|
||||
{
|
||||
LoadDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadDefault()
|
||||
|
||||
Reference in New Issue
Block a user