Skip to content

Commit

Permalink
Issue #11138: Error when retrieving bug via SOAP
Browse files Browse the repository at this point in the history
Proper check for return values and avoid returning nulls to count.
  • Loading branch information
rombert committed Nov 10, 2009
1 parent 70bbad2 commit 2656c2f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions api/soap/mc_issue_api.php
Expand Up @@ -222,13 +222,11 @@ function mci_issue_get_custom_fields( $p_issue_id ) {
function mci_issue_get_attachments( $p_issue_id ) {
$t_attachment_rows = bug_get_attachments( $p_issue_id );

if ( $t_attachment_rows === false) {
return null;
if ( $t_attachment_rows == null) {
return array();
}


$t_result = array();

foreach( $t_attachment_rows as $t_attachment_row ) {
$t_attachment = array();
$t_attachment['id'] = $t_attachment_row['id'];
Expand All @@ -240,7 +238,7 @@ function mci_issue_get_attachments( $p_issue_id ) {
$t_result[] = $t_attachment;
}

return (count( $t_result ) == 0 ? null : $t_result );
return $t_result;
}

/**
Expand Down

0 comments on commit 2656c2f

Please sign in to comment.