skip empty content

This commit is contained in:
yuanchuan 2017-02-27 15:11:28 +08:00
parent 52c3b9ab1b
commit 2069df7469
2 changed files with 4 additions and 0 deletions

View File

@ -602,6 +602,8 @@ class Doodle extends HTMLElement {
this.getAttribute('grid') || '1x1'
);
if (!this.innerHTML.trim()) return false;
// clear content before throwing error
try {
compiled = compile(this.innerHTML, this.size);

View File

@ -52,6 +52,8 @@ class Doodle extends HTMLElement {
this.getAttribute('grid') || '1x1'
);
if (!this.innerHTML.trim()) return false;
// clear content before throwing error
try {
compiled = compile(this.innerHTML, this.size);