Removed some redundant code
This commit is contained in:
tidusjar 2016-03-24 19:45:02 +00:00
parent 47c0c0daf0
commit 25a8563ee8
9 changed files with 32 additions and 56 deletions

View file

@ -115,6 +115,13 @@ namespace PlexRequests.UI.Modules
var oldPass = Request.Form.OldPassword;
var newPassword = Request.Form.NewPassword;
var newPasswordAgain = Request.Form.NewPasswordAgain;
if (string.IsNullOrEmpty(oldPass) || string.IsNullOrEmpty(newPassword) ||
string.IsNullOrEmpty(newPasswordAgain))
{
return Response.AsJson(new JsonResponseModel { Message = "Please fill in all fields", Result = false });
}
if (!newPassword.Equals(newPasswordAgain))
{
return Response.AsJson(new JsonResponseModel { Message = "The passwords do not match", Result = false });