From cac5c0f0dd055a28a3549f98d6ec9db3bc398eda Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Thu, 31 Mar 2016 15:55:32 -0400
Subject: Improved handling of invalid incoming and outgoing webhooks

---
 webapp/utils/async_client.jsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'webapp/utils/async_client.jsx')

diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index cc19baa7e..db0b2258c 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -1182,10 +1182,10 @@ export function addIncomingHook(hook, success, error) {
             }
         },
         (err) => {
-            dispatchError(err, 'addIncomingHook');
-
             if (error) {
                 error(err);
+            } else {
+                dispatchError(err, 'addIncomingHook');
             }
         }
     );
@@ -1205,10 +1205,10 @@ export function addOutgoingHook(hook, success, error) {
             }
         },
         (err) => {
-            dispatchError(err, 'addOutgoingHook');
-
             if (error) {
                 error(err);
+            } else {
+                dispatchError(err, 'addOutgoingHook');
             }
         }
     );
-- 
cgit v1.2.3-1-g7c22

