Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/RestApiClientSharp/RestApiClient.Rest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,18 @@ protected virtual IRestApiRequestRespone ValidateResponse(RestResponse? response
if (!IsOnline) return apiRsponeResult;
try
{
// If there is no file specified
if (file is null && localFilePath is null)
// and there are no additional parameters supplied, throw
if (parameters?.Count == 0)
// If there is no file specified and there are no additional parameters supplied, throw
if (parameters?.Count == 0)
{
if (file is null)
throw new ArgumentNullException(
nameof(file),
$"No file, localFilePath and paramaters have been provided! Set at least one of those three parameters!");
else if (localFilePath is null)
throw new ArgumentNullException(
$"{nameof(file)} / {nameof(localFilePath)} / {nameof(parameters)}",
nameof(localFilePath),
$"No file, localFilePath and paramaters have been provided! Set at least one of those three parameters!");
}
if (RestClient is null)
{
UpdateRestClientInstance();
Expand Down
Loading