fix bad network throwing nullreferenceexception

This commit is contained in:
nicolas.dorier
2018-01-12 22:08:20 +09:00
parent 2b7c70622f
commit b5e4c803aa

View File

@@ -72,6 +72,10 @@ namespace BTCPayServer.Configuration
if (network != null)
{
var n = Network.GetNetwork(network);
if (n == null)
{
throw new ConfigException($"Invalid network parameter '{network}'");
}
return n.ToChainType();
}
var net = conf.GetOrDefault<bool>("regtest", false) ? ChainType.Regtest :