Indicate if there's no existing preferred email address

Show "(none)" when there's no existing preferred email address instead
of an unitialized variable warning.
This commit is contained in:
Martin Michlmayr 2016-05-05 17:27:48 -07:00
parent fd6b55e7be
commit c94f0001b9

View file

@ -39,7 +39,7 @@ my $sp = new Supporters($dbh, [ "none" ]);
$sp->addEmailAddress($supporterId, $email, $emailType); $sp->addEmailAddress($supporterId, $email, $emailType);
print "Preferred email address was: ", $sp->getPreferredEmailAddress($supporterId), "\n"; print "Preferred email address was: ", $sp->getPreferredEmailAddress($supporterId) || "(none)", "\n";
if ($preferred) { if ($preferred) {
$sp->setPreferredEmailAddress($supporterId, $email); $sp->setPreferredEmailAddress($supporterId, $email);
print "Preferred email address is now: ", $sp->getPreferredEmailAddress($supporterId), "\n"; print "Preferred email address is now: ", $sp->getPreferredEmailAddress($supporterId), "\n";