Skip to content

Commit 147f4e2

Browse files
committed
Avoiding edge case
Sometimes the API will return a PR from some other repository... and nothing else. Skip this.
1 parent 38609f5 commit 147f4e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GithubApi.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ public function getPullRequestForCommit(string $commit, string $repo): ?array
160160
}
161161
}
162162

163+
if (!$bestItem) {
164+
return null;
165+
}
166+
163167
return [
164168
'number' => $bestItem['number'],
165169
'url' => $bestItem['html_url'],

0 commit comments

Comments
 (0)