diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-12-02 18:05:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-12-02 18:05:08 +0000 |
commit | 0c9e00d52568843b1f4c3e8b02b9e47eccceb6ea (patch) | |
tree | 701e1c2a1ad556df31f56f43f3ff4099a9ddc7d7 /perllib/FixMyStreet/EmailSend.pm | |
parent | b6fcd966d204d35c149b2bff91513e732f3101c8 (diff) |
Pass in EmailSend arguments as a hashref.
A fix to bb1e797; when started via a Catalyst model, e.g. send_email in
FixMyStreet::App, an empty hashref is passed in.
Diffstat (limited to 'perllib/FixMyStreet/EmailSend.pm')
-rw-r--r-- | perllib/FixMyStreet/EmailSend.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/EmailSend.pm b/perllib/FixMyStreet/EmailSend.pm index 29c93b2d6..1c6e2cf7a 100644 --- a/perllib/FixMyStreet/EmailSend.pm +++ b/perllib/FixMyStreet/EmailSend.pm @@ -64,7 +64,8 @@ if ( FixMyStreet->test_mode ) { } sub new { - my ($cls, %hash) = @_; - my %args = ( %$args, %hash ); + my ($cls, $hash) = @_; + $hash ||= {}; + my %args = ( %$args, %$hash ); return Email::Send->new(\%args); } |