Skip to content

Commit 4c76ba8

Browse files
authored
Fixes issue of __str__ raising exception when DecodeUrl is None
If DecodeUrl attribute is None then __str__ method will raise '''TypeError: __str__ returned non-string (type NoneType)'''. To avoid it we can ensure that __str__ method returns string type of object.
1 parent 7ed4583 commit 4c76ba8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

office365/sharepoint/types/resource_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def entity_type_name(self):
4444
return "SP.ResourcePath"
4545

4646
def __str__(self):
47-
return self.DecodedUrl
47+
return self.DecodedUrl or ""
4848

4949
def __repr__(self):
5050
return self.DecodedUrl or self.entity_type_name

0 commit comments

Comments
 (0)