diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-01-14 17:37:21 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-01-14 17:37:21 +0000 |
commit | 9b060b83bb6a18b3a2767960726f5f84b52fe93d (patch) | |
tree | ecb1730aff9d52460481ccaa49a17c941f4f8574 | |
parent | e9e56af843d7527a9b53f1615e88edaff06578f9 (diff) |
Name on report might not be present, don't use it if it's not there.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 3a6986134..5b53c5dbf 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -147,7 +147,7 @@ sub report_new_ajax : Path('mobile') : Args(0) { } else { $c->stash->{token_url} = $c->uri_for_email( '/P', $token->token ); $c->send_email( 'problem-confirm.txt', { - to => [ [ $report->user->email, $report->name ] ], + to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ], } ); $c->stash->{ json_response } = { success => 1 }; } @@ -1125,7 +1125,7 @@ sub redirect_or_confirm_creation : Private { } ); $c->stash->{token_url} = $c->uri_for_email( '/P', $token->token ); $c->send_email( 'problem-confirm.txt', { - to => [ [ $report->user->email, $report->name ] ], + to => [ $report->name ? [ $report->user->email, $report->name ] : $report->user->email ], } ); # tell user that they've been sent an email |