From 4513c8913d72736a0133d95503cf17df9190b1e7 Mon Sep 17 00:00:00 2001 From: Kseniya Tomskikh Date: Mon, 9 Oct 2017 11:58:03 +0700 Subject: TRIAL-52 Fixed check of intervention for null value of delivery method --- src/main/scala/xyz/driver/pdsuidomain/entities/Intervention.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/scala/xyz/driver') diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/Intervention.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/Intervention.scala index 9ccc267..cc831cd 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/entities/Intervention.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/entities/Intervention.scala @@ -208,8 +208,7 @@ final case class Intervention(id: LongId[Intervention], isActive: Boolean, deliveryMethod: Option[String]) { def deliveryMethodIsCorrect: Boolean = { - if (this.typeId.nonEmpty) { - this.deliveryMethod.nonEmpty && + if (this.typeId.nonEmpty && this.deliveryMethod.nonEmpty) { InterventionType.All .getOrElse(this.typeId.get, throw new IllegalArgumentException(s"Not found Intervention type ${this.typeId}")) .deliveryMethods -- cgit v1.2.3