Skip to content

Commit a00abf5

Browse files
author
Nick Barrett
committed
Fix case where text is None.
1 parent b727312 commit a00abf5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/onelogin/saml2/response.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,10 @@ def get_attributes(self):
349349
for attr in attribute_node.iterchildren('{%s}AttributeValue' % OneLogin_Saml2_Constants.NSMAP['saml']):
350350
# Remove any whitespace (which may be present where attributes are
351351
# nested inside NameID children).
352-
text = attr.text.strip()
353-
if text:
354-
values.append(text)
352+
if attr.text:
353+
text = attr.text.strip()
354+
if text:
355+
values.append(text)
355356

356357
# Parse any nested NameID children
357358
for nameid in attr.iterchildren('{%s}NameID' % OneLogin_Saml2_Constants.NSMAP['saml']):

0 commit comments

Comments
 (0)