From 389d36abd716c558578b3ebb588fa90daf1342e6 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 17 Feb 2010 10:15:35 -0500 Subject: [PATCH] MFB: Catch errors, at least until these throw exceptions --- turba/lib/View/Browse.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/turba/lib/View/Browse.php b/turba/lib/View/Browse.php index 262b01da3..8a7edfec3 100644 --- a/turba/lib/View/Browse.php +++ b/turba/lib/View/Browse.php @@ -239,6 +239,10 @@ class Turba_View_Browse { break; } $targetDriver = Turba_Driver::singleton($targetSource); + if ($targetDriver instanceof PEAR_Error) { + $notification->push(sprintf_("Could not load driver for %s", $targetSource), 'horde.error'); + break; + } $target = &$targetDriver->getObject($targetKey); if (is_a($target, 'PEAR_Error')) { $notification->push($target, 'horde.error'); @@ -247,6 +251,10 @@ class Turba_View_Browse { } else { $targetSource = $vars->get('targetAddressbook'); $targetDriver = Turba_Driver::singleton($targetSource); + if ($targetDriver instanceof PEAR_Error) { + $notification->push(sprintf_("Could not load driver for %s", $targetSource), 'horde.error'); + break; + } } if (!empty($target) && $target->isGroup()) { // Adding contact to an existing list. -- 2.11.0