From d8a839990b790ff7e2fa560cdc414ec5e24b23e4 Mon Sep 17 00:00:00 2001 From: Shoma Nishitateno Date: Tue, 22 May 2018 17:32:17 +0900 Subject: [PATCH] Clean: --- .../com/nulabinc/backlog/c2b/services/MappingFiles.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala index a2d67f1..fc714ed 100644 --- a/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala +++ b/src/main/scala/com/nulabinc/backlog/c2b/services/MappingFiles.scala @@ -46,7 +46,12 @@ object MappingFiles { backlogUsers <- AppDSL.streamAsSeq(backlogUserStream).orFail userHashMap = userNames.map { case (cybozu, backlog) => - (cybozu, backlogUsers.find(_.name == backlog).get.userId.getOrElse(throw new RuntimeException("It never happened. Admin user can get userId."))) // TODO: + val backlogUserId = backlogUsers + .find(_.name == backlog) + .getOrElse(throw new RuntimeException("It never happen. It has already validated.")) + .userId + .getOrElse(throw new RuntimeException("It never happen. Admin user can get userId.")) + (cybozu, backlogUserId) } userMappings = indexSeqToHashMap(userHashMap) priorityMappingStream <- read(Config.PRIORITIES_PATH)