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:
parent
b88d2ecd77
commit
cf3f36ac52
@ -79,7 +79,7 @@ def _validate_node(node):
|
|||||||
:returns: The local portion of a JID, as validated by nodeprep.
|
:returns: The local portion of a JID, as validated by nodeprep.
|
||||||
"""
|
"""
|
||||||
if node is None:
|
if node is None:
|
||||||
return None
|
return ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node = nodeprep(node)
|
node = nodeprep(node)
|
||||||
@ -160,7 +160,7 @@ def _validate_resource(resource):
|
|||||||
:returns: The local portion of a JID, as validated by resourceprep.
|
:returns: The local portion of a JID, as validated by resourceprep.
|
||||||
"""
|
"""
|
||||||
if resource is None:
|
if resource is None:
|
||||||
return None
|
return ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
resource = resourceprep(resource)
|
resource = resourceprep(resource)
|
||||||
|
Loading…
Reference in New Issue
Block a user