Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-27 18:08:04 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-04-03 15:30:11 +0300
commit51d0633adc62fb5481bd5a9937defbe484453c38 (patch)
tree421c321df98a321d0622767528ff48d52f3f2a24 /src
parent7d17cf8f28f0419b81d8d80e9b849c95029a6cb2 (diff)
Catch UID parsing errors
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'src')
-rw-r--r--src/util/EnvelopeUidParser.js5
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],