summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-12-07 12:58:23 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-12-07 12:58:23 -0500
commitfaf8f421103194be9af09dd8d24c582437bb7d2f (patch)
tree206c446ac4b400abcf3c5e1aa232f44d2a271927 /app/assets
parente7b045eadaf315dc2ae4fc079af5d1199d3e5d25 (diff)
downloadgitlab-ce-faf8f421103194be9af09dd8d24c582437bb7d2f.tar.gz
Do nothing if file is undefinedfix-reset-template
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/blob/template_selector.js.es62
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/template_selector.js.es6 b/app/assets/javascripts/blob/template_selector.js.es6
index 5434a19bcec..0ff5c0fab05 100644
--- a/app/assets/javascripts/blob/template_selector.js.es6
+++ b/app/assets/javascripts/blob/template_selector.js.es6
@@ -70,6 +70,8 @@
// e.g.
// Api.gitignoreText item.name, @requestFileSuccess.bind(@)
requestFileSuccess(file, { skipFocus } = {}) {
+ if (!file) return;
+
const oldValue = this.editor.getValue();
let newValue = file.content;