mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix a potential bug of UnboundLocalError (#8329)
Replaced with less buggier control flow
This commit is contained in:
parent
a3f124b821
commit
53284c425e
1
changelog.d/8329.bugfix
Normal file
1
changelog.d/8329.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix UnboundLocalError from occuring when appservices send malformed register request.
|
@ -431,11 +431,14 @@ class RegisterRestServlet(RestServlet):
|
||||
|
||||
access_token = self.auth.get_access_token_from_request(request)
|
||||
|
||||
if isinstance(desired_username, str):
|
||||
if not isinstance(desired_username, str):
|
||||
raise SynapseError(400, "Desired Username is missing or not a string")
|
||||
|
||||
result = await self._do_appservice_registration(
|
||||
desired_username, access_token, body
|
||||
)
|
||||
return 200, result # we throw for non 200 responses
|
||||
|
||||
return 200, result
|
||||
|
||||
# == Normal User Registration == (everyone else)
|
||||
if not self._registration_enabled:
|
||||
|
Loading…
Reference in New Issue
Block a user