Skip to content

Commit 2e31f4a

Browse files
committed
Fix GitHub API response in PullsModel handling by using getBody() and improve empty pulls check
1 parent 1ff9f09 commit 2e31f4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

administrator/components/com_patchtester/src/Model/PullsModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function requestFromGithub(int $page): array
345345
$page,
346346
$batchSize
347347
);
348-
$pulls = json_decode($pullsResponse->body);
348+
$pulls = json_decode((string) $pullsResponse->getBody());
349349
} catch (UnexpectedResponse $exception) {
350350
throw new RuntimeException(
351351
Text::sprintf(
@@ -387,7 +387,7 @@ public function requestFromGithub(int $page): array
387387
}
388388

389389
// If there are no pulls to insert then bail, assume we're finished
390-
if (count($pulls) === 0) {
390+
if (empty($pulls)) {
391391
return ['complete' => true];
392392
}
393393

0 commit comments

Comments
 (0)