private void onSubmitResult(final ChangeDetail result) {
if (result.getChange().getStatus() == Change.Status.NEW) {
// The submit failed. Try to locate the message and display
// it to the user, it should be the last one created by Gerrit.
//
ChangeMessage msg = null;
if (result.getMessages() != null && result.getMessages().size() > 0) {
for (int i = result.getMessages().size() - 1; i >= 0; i--) {
if (result.getMessages().get(i).getAuthor() == null) {
msg = result.getMessages().get(i);
break;