Do not throw NullReferenceException
MODIFY
WalletWasabi/JsonConverters/Bitcoin/FeeRateJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/FeeRateJsonConverter.cs
@@ -14,15 +14,8 @@ namespace WalletWasabi.JsonConverters.Bitcoin
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, FeeRate? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.FeePerK.Satoshi);
}
}
}
-}

MODIFY
WalletWasabi/JsonConverters/Bitcoin/MoneyBtcJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/MoneyBtcJsonConverter.cs
@@ -26,15 +26,8 @@ namespace WalletWasabi.JsonConverters.Bitcoin
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, Money? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.ToString(fplus: false, trimExcessZero: true));
}
}
}
-}

MODIFY
WalletWasabi/JsonConverters/Bitcoin/MoneySatoshiJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/MoneySatoshiJsonConverter.cs
@@ -15,15 +15,8 @@ namespace WalletWasabi.JsonConverters.Bitcoin
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, Money? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.Satoshi);
}
}
}
-}

MODIFY
WalletWasabi/JsonConverters/Bitcoin/ScriptJsonConverter.cs
WalletWasabi/JsonConverters/Bitcoin/ScriptJsonConverter.cs
@@ -19,15 +19,8 @@ namespace WalletWasabi.JsonConverters.Bitcoin
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, Script? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.ToString());
}
}
}
-}

MODIFY
WalletWasabi/JsonConverters/BitcoinAddressJsonConverter.cs
WalletWasabi/JsonConverters/BitcoinAddressJsonConverter.cs
@@ -22,15 +22,8 @@ namespace WalletWasabi.JsonConverters
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, BitcoinAddress? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.ToString());
}
}
}
-}

MODIFY
WalletWasabi/JsonConverters/BitcoinEncryptedSecretNoECJsonConverter.cs
WalletWasabi/JsonConverters/BitcoinEncryptedSecretNoECJsonConverter.cs
@@ -20,15 +20,8 @@ namespace WalletWasabi.JsonConverters
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, BitcoinEncryptedSecretNoEC? value, JsonSerializer serializer)
- {
- if (value is null)
- {
- throw new NullReferenceException();
- }
- else
{
writer.WriteValue(value.ToWif());
}
}
}
-}

Do not throw NullReferenceException