Skip to content

Commit b6f1d40

Browse files
committed
refactor: add check for url
1 parent 4f468e6 commit b6f1d40

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Connection/RESTConnector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ public bool? DisableSslVerification
264264
///
265265
public static RESTConnector GetConnector(Authenticator authenticator, string function, string url)
266266
{
267+
if (string.IsNullOrEmpty(url))
268+
{
269+
throw new ArgumentNullException("The Url must not be empty or null.");
270+
}
271+
267272
if (Utility.HasBadFirstOrLastCharacter(url))
268273
{
269274
throw new ArgumentException("The Url property is invalid. Please remove any surrounding {{, }}, or \" characters.");

Connection/WSConnector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ public static string FixupURL(string URL)
330330
/// <returns>The WSConnector object or null or error.</returns>
331331
public static WSConnector CreateConnector(Authenticator authenticator, string function, string args, string url)
332332
{
333+
if (string.IsNullOrEmpty(url))
334+
{
335+
throw new ArgumentNullException("The Url must not be empty or null.");
336+
}
337+
333338
if (Utility.HasBadFirstOrLastCharacter(url))
334339
{
335340
throw new ArgumentException("The Url property is invalid. Please remove any surrounding {{, }}, or \" characters.");

0 commit comments

Comments
 (0)