Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/no-carrier.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Rebert <code@rebertia.com>2015-04-14 06:02:58 +0300
committerChris Rebert <code@rebertia.com>2015-04-14 06:02:58 +0300
commit015c219fef20b7bc941d8fa2981d1a39732ae7a4 (patch)
tree61779c61ab1baf4aa53c4ad592ea2be0c1f8b969 /src
parentac9f74afe1d1d58b1fb42cf7050e6ca56820ea8e (diff)
An issue's description doesn't count as a comment
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala b/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala
index 0d980fd..13a87aa 100644
--- a/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala
+++ b/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala
@@ -8,9 +8,12 @@ import InstantOrdering._
class FancyIssue(val issue: Issue, val label: String, val timeout: Duration)(implicit clock: Clock) {
lazy val lastLabelledAt: Instant = issue.lastLabelledWithAt(label).get
- lazy val lastCommentedOnAt: Instant = issue.smartComments.map{ _.createdAt.toInstant }.max
+ lazy val lastCommentedOnAt: Option[Instant] = issue.smartComments.map{ _.createdAt.toInstant }.maxOption
lazy val lastClosedAt: Option[Instant] = issue.smartEvents.filter{ _.isClosed }.map{ _.createdAt.toInstant }.maxOption
- lazy val hasSubsequentComment: Boolean = lastLabelledAt < lastCommentedOnAt
+ lazy val hasSubsequentComment: Boolean = lastCommentedOnAt match {
+ case None => false
+ case Some(commentedAt) => lastLabelledAt < commentedAt
+ }
lazy val wasClosedAfterLabelling: Boolean = lastClosedAt match {
case None => false
case Some(closedAt) => lastLabelledAt < closedAt