mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
NadekoBot.Extensions should now be fully annotated with nullable reference types as well as many classes from NadekoBot.Common
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json;
|
||||
using NadekoBot.Common.JsonConverters;
|
||||
|
||||
namespace NadekoBot.Common;
|
||||
@@ -13,11 +13,11 @@ public class JsonSeria : ISeria
|
||||
public byte[] Serialize<T>(T data)
|
||||
=> JsonSerializer.SerializeToUtf8Bytes(data, _serializerOptions);
|
||||
|
||||
public T Deserialize<T>(byte[] data)
|
||||
public T? Deserialize<T>(byte[]? data)
|
||||
{
|
||||
if (data is null)
|
||||
return default;
|
||||
|
||||
return JsonSerializer.Deserialize<T>(data, _serializerOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user