diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-11 18:05:33 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-09 16:01:16 -0600 |
commit | 5c0802deae6a3a87e7a497d3250cbeb98e61045b (patch) | |
tree | 7390d2e5fa2f0848b00af75c440b4e320f2a2898 | |
parent | acfe967eb587078672953971673e2cd2c02b43ee (diff) | |
download | gitlab-ce-5c0802deae6a3a87e7a497d3250cbeb98e61045b.tar.gz |
Add check in case the data attribute does not exist
-rw-r--r-- | app/assets/javascripts/droplab/droplab_ajax.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/droplab/droplab_ajax.js b/app/assets/javascripts/droplab/droplab_ajax.js index 629260006f3..ebb518eeef4 100644 --- a/app/assets/javascripts/droplab/droplab_ajax.js +++ b/app/assets/javascripts/droplab/droplab_ajax.js @@ -47,7 +47,11 @@ require('../window')(function(w){ this._loadUrlData(config.endpoint).then(function(d) { if (config.loadingTemplate) { - hook.list.list.querySelector('[data-loading-template]').outerHTML = self.listTemplate; + var dataLoadingTemplate = hook.list.list.querySelector('[data-loading-template]'); + + if (dataLoadingTemplate) { + dataLoadingTemplate.outerHTML = self.listTemplate; + } } hook.list[config.method].call(hook.list, d); }).catch(function(e) { |