From b7548fb9e2236c20271a40a39b721e314478c431 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 10 Mar 2011 18:08:14 +0000 Subject: [PATCH] Show a reasonable error message when an image is bad, instead of letting the exception continue bubbling up. --- actions/newapplication.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/newapplication.php b/actions/newapplication.php index eb13593536..657c7bcb71 100644 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@ -22,7 +22,7 @@ * @category Applications * @package StatusNet * @author Zach Copley - * @copyright 2008-2009 StatusNet, Inc. + * @copyright 2008-2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -290,7 +290,13 @@ class NewApplicationAction extends OwnerDesignAction $app->query('ROLLBACK'); } - $app->uploadLogo(); + try { + $app->uploadLogo(); + } catch (Exception $e) { + $app->query('ROLLBACK'); + $this->showForm(_('Invalid image.')); + return; + } $app->query('COMMIT'); -- 2.39.5