diff --git a/lib/inflate.js b/lib/inflate.js index 104def2..7535d15 100644 --- a/lib/inflate.js +++ b/lib/inflate.js @@ -153,7 +153,12 @@ function Inflate(options) { } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } - if (opt.raw) zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); //In raw mode we need to set the dictionary early + if (opt.raw) { //In raw mode we need to set the dictionary early + status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + } } }