lz-string
lz-string copied to clipboard
LZString throws w is undefined exception
We got some, not so nice, error messages out of LZString.
018-02-16T14:03:22.222Z - error: TypeError: Cannot read property 'charAt' of undefined
at Object._decompress (/hackmd/node_modules/lz-string/libs/lz-string.js:473:24)
at Object.decompressFromBase64 (/hackmd/node_modules/lz-string/libs/lz-string.js:44:21)
Result:
LZString throws an `Cannot read property `charAt` of undefined
Expected result:
LZString returns an empty string as it usually does in case of invalid base64 strings.
Steps to reproduce:
- Load LZString
- Call
LZString.decompressFromBase64("zadachi")
As comparsion:
- Load LZString
- Call
LZString.decompressFromBase64("asdf")
Related https://github.com/hackmdio/hackmd/issues/727