From 82c0f6fc0f4d24886c0314cd4236cb0ebd85b635 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Tue, 7 Aug 2018 07:47:47 +1000 Subject: [PATCH] hopefully fix beta.coriolis.edcd.io --- src/app/utils/ShortenUrl.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/utils/ShortenUrl.js b/src/app/utils/ShortenUrl.js index 5e1b403d..f2c31a63 100644 --- a/src/app/utils/ShortenUrl.js +++ b/src/app/utils/ShortenUrl.js @@ -1,6 +1,14 @@ import request from 'superagent'; -const agent = request.agent(); +let agent; +try { + agent = request.agent(); // apparently this crashes somehow +} catch (e) { + console.error(e); +} +if (!agent) { + agent = request; +} /** * Shorten a URL