From bbad10a2c85ab3152c46f670dcea07638aa4062d Mon Sep 17 00:00:00 2001 From: Deantwo <2676134+Deantwo@users.noreply.github.com> Date: Thu, 16 Jan 2020 15:53:06 +0100 Subject: [PATCH] Throw exception on invalid resource query Fixes #1404 --- src/RestSharp/RestRequest.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/RestSharp/RestRequest.cs b/src/RestSharp/RestRequest.cs index 16c490a40..fdf0c2807 100644 --- a/src/RestSharp/RestRequest.cs +++ b/src/RestSharp/RestRequest.cs @@ -92,6 +92,11 @@ static IEnumerable ParseQuery(string query) .Select( x => { + if (x == string.Empty) + throw new ArgumentException( + "resource contains an invalid query." + ); + var position = x.IndexOf('='); return position > 0