Skip to content
Snippets Groups Projects
Commit f43041aa authored by David Baker's avatar David Baker
Browse files

Check absent before trying to access keys

parent 73605f80
No related branches found
No related tags found
No related merge requests found
......@@ -224,6 +224,9 @@ class RegisterRestServlet(RestServlet):
if k not in body:
absent.append(k)
if len(absent) > 0:
raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM)
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
'email', body['email']
)
......@@ -231,9 +234,6 @@ class RegisterRestServlet(RestServlet):
if existingUid is not None:
raise SynapseError(400, "Email is already in use", Codes.THREEPID_IN_USE)
if len(absent) > 0:
raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM)
ret = yield self.identity_handler.requestEmailToken(**body)
defer.returnValue((200, ret))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment