diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2019-04-03 15:50:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 15:50:52 +0300 |
commit | cde48a3878156adfabcf61e15787c8a461380dc3 (patch) | |
tree | a2cea930570150b936d3ba4f9c3cba8e9f3f440c /src | |
parent | 997479ec096a46561403a01357b41006c03d5278 (diff) | |
parent | 51d0633adc62fb5481bd5a9937defbe484453c38 (diff) |
Merge pull request #1633 from nextcloud/fix/uid-parsing-error
Catch UID parsing errors
Diffstat (limited to 'src')
-rw-r--r-- | src/util/EnvelopeUidParser.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/EnvelopeUidParser.js b/src/util/EnvelopeUidParser.js index 38c5115cd..ecc9d92a9 100644 --- a/src/util/EnvelopeUidParser.js +++ b/src/util/EnvelopeUidParser.js @@ -24,6 +24,11 @@ const reg = /^(\d+)-((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3} export const parseUid = str => { const match = reg.exec(str) + if (match === null) { + console.error(`UID ${str} is invalid`) + throw new Error(`UID ${str} is invalid`) + } + return { accountId: parseInt(match[1], 10), folderId: match[2], |