Skip to content

Commit aea56bb

Browse files
committed
Return empty list when there are no audience values
1 parent bfdedb3 commit aea56bb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/onelogin/saml2/response.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,8 @@ def get_audiences(self):
246246
:returns: The valid audiences for the SAML Response
247247
:rtype: list
248248
"""
249-
audiences = []
250-
251249
audience_nodes = self.__query_assertion('/saml:Conditions/saml:AudienceRestriction/saml:Audience')
252-
for audience_node in audience_nodes:
253-
audiences.append(audience_node.text)
254-
return audiences
250+
return [node.text for node in audience_nodes if node.text is not None]
255251

256252
def get_issuers(self):
257253
"""

0 commit comments

Comments
 (0)