diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-12 20:08:15 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-10 01:01:19 +0300 |
commit | 8925c9604f95b66a9b8a4579e321961312bfc78d (patch) | |
tree | de54edba8c094b82c6a0603a3bed11ee8b15a8ee /app | |
parent | 274f3e23e35ddf3116cd7c227b94ce68378c76af (diff) |
Add additional check before setting outerHTML
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/droplab/droplab_ajax_filter.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/droplab/droplab_ajax_filter.js b/app/assets/javascripts/droplab/droplab_ajax_filter.js index 6e1eb080e3b..c6c062d0886 100644 --- a/app/assets/javascripts/droplab/droplab_ajax_filter.js +++ b/app/assets/javascripts/droplab/droplab_ajax_filter.js @@ -78,7 +78,11 @@ require('../window')(function(w){ this._loadUrlData(config.endpoint + this.buildParams(params)).then(function(data) { if (config.loadingTemplate && self.hook.list.data === undefined || self.hook.list.data.length === 0) { - self.hook.list.list.querySelector('[data-loading-template]').outerHTML = self.listTemplate; + const dataLoadingTemplate = self.hook.list.list.querySelector('[data-loading-template]'); + + if (dataLoadingTemplate) { + dataLoadingTemplate.outerHTML = self.listTemplate; + } } if (!self.destroyed) { |