From c505652c15ad7fdc542b77313baf52cffa009f8f Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 29 Apr 2017 14:48:46 +0200 Subject: [PATCH] Confirm_address::getByAddress not getAddress Also fixed the error handling to match the function call. --- scripts/resend_confirm_address.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/resend_confirm_address.php b/scripts/resend_confirm_address.php index 1e5bcc1555..b73246d6ef 100755 --- a/scripts/resend_confirm_address.php +++ b/scripts/resend_confirm_address.php @@ -33,9 +33,10 @@ $ca = null; if (have_option('e', 'email')) { $email = get_option_value('e', 'email'); - $ca = Confirm_address::getAddress($email, 'email'); - if (!$ca instanceof Confirm_address) { - print "Can't find email $email in confirm_address table.\n"; + try { + $ca = Confirm_address::getByAddress($email, 'email'); + } catch (NoResultException $e) { + print sprintf("Can't find %s address %s in %s table.\n", $e->obj->address_type, $e->obj->address, $e->obj->tableName()); exit(1); } } elseif (have_option('a', 'all')) {