Skip to content

Commit 07fe4e8

Browse files
authored
Merge pull request lesstif#55 from say1hello/master
Add is_array check in IssueService::addAttachments
2 parents 08e1f4a + 7d58d68 commit 07fe4e8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Issue/IssueService.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,13 @@ 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+
$ret = json_decode($ret);
137+
if (is_array($ret)) {
138+
array_push($resArr, $this->json_mapper->mapArray(
139+
$ret, new \ArrayObject(), '\JiraRestApi\Issue\Attachment'
140+
)
141+
);
142+
}
140143
}
141144

142145
return $resArr;

0 commit comments

Comments
 (0)