Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid NRE in ImportRemoteInstanceController.import() #12330

Merged
merged 2 commits into from
Sep 6, 2022

Conversation

hishamco
Copy link
Member

@hishamco hishamco commented Sep 4, 2022

No description provided.

Co-authored-by: Jasmin Savard <[email protected]>
@hishamco hishamco merged commit 07a145c into main Sep 6, 2022
@hishamco hishamco deleted the hishamco/remote-deployment branch September 6, 2022 06:35
@@ -43,9 +43,14 @@ public async Task<IActionResult> Import(ImportViewModel model)

var remoteClient = remoteClientList.RemoteClients.FirstOrDefault(x => x.ClientName == model.ClientName);

if (remoteClient == null)
{
return StatusCode((int)HttpStatusCode.BadRequest, "The remote client was not provided");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for info the following does the same, yes better to not do it here for consistency with other lines of code below, but maybe a good canditate for a separate PR ;)

            return BadRequest("The remote client was not provided");

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to check the entire code to see if we have such thing .. thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hishamco hishamco added this to the 1.5 milestone Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants