From 4c76ba8b6d8d030fae2016b3b3cda3b530aa3b28 Mon Sep 17 00:00:00 2001 From: Ali-Huseynov <71327085+Ali-Huseynov@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:15:21 +0400 Subject: [PATCH] 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. --- office365/sharepoint/types/resource_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/office365/sharepoint/types/resource_path.py b/office365/sharepoint/types/resource_path.py index 1fcbfb87..5db08173 100644 --- a/office365/sharepoint/types/resource_path.py +++ b/office365/sharepoint/types/resource_path.py @@ -44,7 +44,7 @@ def entity_type_name(self): return "SP.ResourcePath" def __str__(self): - return self.DecodedUrl + return self.DecodedUrl or "" def __repr__(self): return self.DecodedUrl or self.entity_type_name