Throw exception if value is null (JsonConverters)
MODIFY
WalletWasabi/JsonConverters/Bitcoin/FeeRateJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/FeeRateJsonConverter.cs
@@ -17,7 +17,7 @@ namespace WalletWasabi.JsonConverters.Bitcoin
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/Bitcoin/MoneyBtcJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/MoneyBtcJsonConverter.cs
@@ -29,7 +29,7 @@ namespace WalletWasabi.JsonConverters.Bitcoin
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/Bitcoin/MoneySatoshiJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/MoneySatoshiJsonConverter.cs
@@ -18,7 +18,7 @@ namespace WalletWasabi.JsonConverters.Bitcoin
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/Bitcoin/ScriptJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/ScriptJsonConverter.cs
@@ -22,7 +22,7 @@ namespace WalletWasabi.JsonConverters.Bitcoin
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/BitcoinAddressJsonConverter.cs
WalletWasabi/JsonConverters/BitcoinAddressJsonConverter.cs
@@ -25,7 +25,7 @@ namespace WalletWasabi.JsonConverters
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/BitcoinEncryptedSecretNoECJsonConverter.cs
WalletWasabi/JsonConverters/BitcoinEncryptedSecretNoECJsonConverter.cs
@@ -23,7 +23,7 @@ namespace WalletWasabi.JsonConverters
{
if (value is null)
{
- writer.WriteNull();
+ throw new NullReferenceException();
}
else
{

MODIFY
WalletWasabi/JsonConverters/EndPointJsonConverter.cs
WalletWasabi/JsonConverters/EndPointJsonConverter.cs
@@ -41,7 +41,7 @@ namespace WalletWasabi.JsonConverters
{
if (value is null)
{
- writer.WriteNull();
+ throw new NotSupportedException($"{nameof(EndPointJsonConverter)} can only convert {nameof(EndPoint)}.");
}
else
{

Throw exception if value is null (JsonConverters)