From 0dcaa59fc6b3d4d7912e04d61ee8da7acb56ce29 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Mon, 5 Mar 2018 10:07:40 -0500 Subject: [PATCH] Check for empty URL --- src/plugins/Url/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/Url/index.js b/src/plugins/Url/index.js index c79cf4b8e..662d53598 100644 --- a/src/plugins/Url/index.js +++ b/src/plugins/Url/index.js @@ -29,7 +29,8 @@ module.exports = class Url extends Plugin { addUrl: 'Add url', import: 'Import', enterUrlToImport: 'Enter file url to import', - failedToFetch: 'Uppy Server failed to fetch this URL' + failedToFetch: 'Uppy Server failed to fetch this URL, please make sure it’s correct', + enterCorrectUrl: 'Please enter correct URL to add file' } } @@ -83,6 +84,12 @@ module.exports = class Url extends Plugin { } addFile (url) { + if (!url) { + this.uppy.log('[URL] Incorrect URL entered') + this.uppy.info(this.i18n('enterCorrectUrl'), 'error', 4000) + return + } + return this.getMeta(url).then((meta) => { const tagFile = { source: this.id,