From: Michael J. Rubinsky Date: Wed, 17 Feb 2010 15:15:35 +0000 (-0500) Subject: MFB: Catch errors, at least until these throw exceptions X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=389d36abd716c558578b3ebb588fa90daf1342e6;p=horde.git MFB: Catch errors, at least until these throw exceptions --- 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.