Skip to content

Commit

Permalink
update saml lib
Browse files Browse the repository at this point in the history
  • Loading branch information
arturo-seijas committed Mar 20, 2024
1 parent 2797f32 commit 96efe2b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/charms/saml_integrator/v0/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class method `from_relation_data`.

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 7
LIBPATCH = 8

# pylint: disable=wrong-import-position
import re
Expand Down Expand Up @@ -297,10 +297,8 @@ def get_relation_data(self) -> typing.Optional[SamlRelationData]:
SmtpRelationData: the relation data.
"""
relation = self.model.get_relation(self.relation_name)
if not relation:
if not relation or not relation.app or not relation.data[relation.app]:
return None
assert relation.data
assert relation.app
return SamlRelationData.from_relation_data(relation.data[relation.app])


Expand Down

0 comments on commit 96efe2b

Please sign in to comment.