Skip to content

Commit

Permalink
Handle whitespace and null value
Browse files Browse the repository at this point in the history
  • Loading branch information
Aravindh-Raju committed May 26, 2022
1 parent d9a4d78 commit 01df5bb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class MembershipService(
// Validate group details. Group name and email cannot be empty
def groupValidation(group: Group): Result[Unit] = {
Option(group) match {
case Some(value) if value.name.isEmpty || value.email.isEmpty =>
case Some(value) if Option(value.name).forall(_.trim.isEmpty) || Option(value.email).forall(_.trim.isEmpty) =>
GroupValidationError(GroupValidationErrorMsg).asLeft
case _ =>
().asRight
Expand Down

0 comments on commit 01df5bb

Please sign in to comment.