diff options
author | Dmitriy Tsvettsikh <dmitrycvet@gmail.com> | 2017-12-04 02:08:37 +0500 |
---|---|---|
committer | Ben Smith <binjimin@gmail.com> | 2017-12-03 13:08:37 -0800 |
commit | 20452b9ef4621dec018670ee8e7190537720841e (patch) | |
tree | d97909ca3fe230d4933ecc56968e85318313d122 /src/wabt.post.js | |
parent | 51f1f3610eb56bad9bf720359c743c499c27feda (diff) | |
download | wabt-20452b9ef4621dec018670ee8e7190537720841e.tar.gz wabt-20452b9ef4621dec018670ee8e7190537720841e.tar.bz2 wabt-20452b9ef4621dec018670ee8e7190537720841e.zip |
add missing check in libwabt.js (#686)
Diffstat (limited to 'src/wabt.post.js')
-rw-r--r-- | src/wabt.post.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wabt.post.js b/src/wabt.post.js index fac81e97..eee84e1e 100644 --- a/src/wabt.post.js +++ b/src/wabt.post.js @@ -320,7 +320,9 @@ WasmModule.prototype.toBinary = function(options) { WasmModule.prototype.destroy = function() { Module._wabt_destroy_module(this.module_addr); - this.lexer.destroy(); + if (this.lexer) { + this.lexer.destroy(); + } }; var exports = { |