Skip to content

Commit

Permalink
Render commitMessage in title attribute only if it exists in JSON
Browse files Browse the repository at this point in the history
[`gerrit query` command documentation](https://review.openstack.org/Documentation/cmd-query.html) page states:

> Note that any field may be missing in the JSON messages, so consumers of this
> JSON stream should deal with that appropriately.

so we additionally check if `commitMessage` field is present in JSON response.

Change-Id: I970326b8cb41294fe6dedeeb88e1e4f249575c64
Signed-off-by: Jindrich Besta <jindrich@amarulasolutions.com>
  • Loading branch information
Jindrich Besta committed Jan 20, 2017
1 parent 838fc9d commit d182195
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -150,7 +150,7 @@
${patch.getString('number')}
</td>
<td onClick="activateRow('${theId}')">
<span title="${res.get('commitMessage')}">
<span title="${res.has('commitMessage') ? res.get('commitMessage') : null}">
${it.toReadableHtml(res.getString('subject'))}
</span>
<j:if test="${res.has('status')}">
Expand Down

0 comments on commit d182195

Please sign in to comment.