diff --git a/src/core/parser.js b/src/core/parser.js index 8c895136e..176884296 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -89,7 +89,7 @@ class Parser { } } - getObj(cipherTransform) { + getObj(cipherTransform = null) { const buf1 = this.buf1; this.shift(); @@ -147,22 +147,20 @@ class Parser { } if (Number.isInteger(buf1)) { // indirect reference or integer - const num = buf1; if (Number.isInteger(this.buf1) && isCmd(this.buf2, 'R')) { - const ref = Ref.get(num, this.buf1); + const ref = Ref.get(buf1, this.buf1); this.shift(); this.shift(); return ref; } - return num; + return buf1; } if (typeof buf1 === 'string') { - let str = buf1; if (cipherTransform) { - str = cipherTransform.decryptString(str); + return cipherTransform.decryptString(buf1); } - return str; + return buf1; } // simple object