Set unset part of a JID to empty string instead of None

it breaks assumptions on the type of the value
This commit is contained in:
mathieui 2016-10-04 19:42:05 +02:00
parent b88d2ecd77
commit cf3f36ac52

View file

@ -79,7 +79,7 @@ def _validate_node(node):
:returns: The local portion of a JID, as validated by nodeprep.
"""
if node is None:
return None
return ''
try:
node = nodeprep(node)
@ -160,7 +160,7 @@ def _validate_resource(resource):
:returns: The local portion of a JID, as validated by resourceprep.
"""
if resource is None:
return None
return ''
try:
resource = resourceprep(resource)