Skip to content

Commit 074992b

Browse files
authored
Add is_array check in IssueService::addAttachments
Add is_array check in \JiraRestApi\Issue\IssueService::addAttachments method
1 parent f0c9c22 commit 074992b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Issue/IssueService.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ public function addAttachments($issueIdOrKey, $filePathArray)
133133

134134
$resArr = array();
135135
foreach ($results as $ret) {
136-
array_push($resArr, $this->json_mapper->mapArray(
137-
json_decode($ret), new \ArrayObject(), '\JiraRestApi\Issue\Attachment'
138-
)
139-
);
136+
if (is_array($ret)) {
137+
array_push($resArr, $this->json_mapper->mapArray(
138+
json_decode($ret), new \ArrayObject(), '\JiraRestApi\Issue\Attachment'
139+
)
140+
);
141+
}
140142
}
141143

142144
return $resArr;

0 commit comments

Comments
 (0)