Skip to content

Commit 6aaaa19

Browse files
Merge pull request #97 from ashawley/fix-null-pr-head-repo
Change head.repo on pull requests to Option
2 parents 9a9079c + 92fa67a commit 6aaaa19

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/scala/codecheck/github/models/PullRequest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ case class PullRequestRef(value: JValue) extends AbstractJson(value) {
5656
def ref = get("ref")
5757
def sha = get("sha")
5858
lazy val user = User(value \ "user")
59-
lazy val repo = Repository(value \ "repo")
59+
lazy val repo = objectOpt("repo")(Repository(_))
6060
}
6161

6262
case class PullRequest(value: JValue) extends AbstractJson(value) {

src/test/scala/PullRequestOpSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class PullRequestOpSpec extends FunSpec with api.Constants {
2424
assert(list.exists(_.deletions == None))
2525
assert(list.exists(_.changed_files == None))
2626
assert(list.exists(_.maintainer_can_modify == None))
27-
assert(list.exists(_.base.repo.full_name == s"$otherUser/$otherUserRepo"))
27+
assert(list.exists(_.base.repo.exists(_.full_name == s"$otherUser/$otherUserRepo")))
2828
assert(list.exists(_.base.user.login == otherUser))
29-
assert(list.exists(_.base.repo.name == otherUserRepo))
29+
assert(list.exists(_.base.repo.exists(_.name == otherUserRepo)))
3030
}
3131
}
3232

0 commit comments

Comments
 (0)