Commit 8925c960 authored by Clement Ho's avatar Clement Ho

Add additional check before setting outerHTML

parent 274f3e23
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment