From 2bed3eb47f27002fd5dee62b5b3906a9bc27b41f Mon Sep 17 00:00:00 2001 From: JKorf Date: Wed, 1 Aug 2018 14:46:35 +0200 Subject: [PATCH] Re-added null checks --- CryptoExchange.Net/Authentication/ApiCredentials.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CryptoExchange.Net/Authentication/ApiCredentials.cs b/CryptoExchange.Net/Authentication/ApiCredentials.cs index f312ae3..721735f 100644 --- a/CryptoExchange.Net/Authentication/ApiCredentials.cs +++ b/CryptoExchange.Net/Authentication/ApiCredentials.cs @@ -35,6 +35,9 @@ namespace CryptoExchange.Net.Authentication /// The private key used for signing public ApiCredentials(string privateKey) { + if(string.IsNullOrEmpty(privateKey)) + throw new ArgumentException("Private key can't be null/empty"); + var securePrivateKey = new SecureString(); foreach (var c in privateKey) securePrivateKey.AppendChar(c); @@ -59,6 +62,9 @@ namespace CryptoExchange.Net.Authentication /// The private key used for signing public ApiCredentials(string key, string secret) { + if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(secret)) + throw new ArgumentException("Key and secret can't be null/empty"); + var secureApiKey = new SecureString(); foreach (var c in key) secureApiKey.AppendChar(c);