From e164dc38a8236d2a72507d2f1e8ab8551a1c2b29 Mon Sep 17 00:00:00 2001 From: Jesper Raemaekers <76244626+jesper-raemaekers@users.noreply.github.com> Date: Sun, 8 Oct 2023 10:25:09 +0200 Subject: [PATCH] Add check for removed workitems #138 (#142) --- polarion/workitem.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polarion/workitem.py b/polarion/workitem.py index 56a895d..6f1ec30 100644 --- a/polarion/workitem.py +++ b/polarion/workitem.py @@ -475,10 +475,12 @@ def getLinkedItemWithRoles(self): service = self._polarion.getService('Tracker') if self.linkedWorkItems is not None: for linked_item in self.linkedWorkItems.LinkedWorkItem: - linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) + if linked_item.role is not None: + linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) if self.linkedWorkItemsDerived is not None: for linked_item in self.linkedWorkItemsDerived.LinkedWorkItem: - linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) + if linked_item.role is not None: + linked_items.append((linked_item.role.id, Workitem(self._polarion, self._project, uri=linked_item.workItemURI))) return linked_items def getLinkedItem(self):