From 3d068aeb6858f1f27acc727474540a085b3b0c6f Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Fri, 28 Jun 2019 11:22:23 -0400 Subject: [PATCH] fix: Potential fix for errant '?' characters in URIs --- ICD.Common.Utils/IcdUriBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ICD.Common.Utils/IcdUriBuilder.cs b/ICD.Common.Utils/IcdUriBuilder.cs index 4a0a212..82a4e04 100644 --- a/ICD.Common.Utils/IcdUriBuilder.cs +++ b/ICD.Common.Utils/IcdUriBuilder.cs @@ -45,7 +45,7 @@ namespace ICD.Common.Utils /// /// Gets or sets any query information included in the URI. /// - public string Query { get { return m_Query == null ? null : "?" + m_Query; } set { m_Query = value; } } + public string Query { get { return string.IsNullOrEmpty(m_Query) ? string.Empty : "?" + m_Query; } set { m_Query = value; } } /// /// Gets or sets the scheme name of the URI. @@ -98,7 +98,7 @@ namespace ICD.Common.Utils Password = uri.GetPassword(); Path = uri.AbsolutePath; Port = (ushort)uri.Port; - Query = uri.Query == null ? null : uri.Query.TrimStart('?'); + Query = uri.Query.TrimStart('?'); Scheme = uri.Scheme; UserName = uri.GetUserName(); }