Skip to content

Commit 0276c20

Browse files
committed
fix: previous fix was incomplete
1 parent 9e97795 commit 0276c20

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

mitreattack/diffStix/changelog_helper.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,16 +1632,17 @@ def is_patch_change(old_stix_obj: dict, new_stix_obj: dict) -> bool:
16321632
return True
16331633

16341634
# description changed, even though modified date didn't
1635-
old_lines = old_stix_obj["description"].replace("\n", " ").splitlines()
1636-
new_lines = new_stix_obj["description"].replace("\n", " ").splitlines()
1637-
old_lines_unique = [line for line in old_lines if line not in new_lines]
1638-
new_lines_unique = [line for line in new_lines if line not in old_lines]
1639-
if old_lines_unique or new_lines_unique:
1640-
logger.warning(
1641-
f"{stix_id} - {attack_id} has a description change "
1642-
"without the version being incremented or the last modified date changing"
1643-
)
1644-
return True
1635+
if "description" in old_stix_obj and "description" in new_stix_obj:
1636+
old_lines = old_stix_obj["description"].replace("\n", " ").splitlines()
1637+
new_lines = new_stix_obj["description"].replace("\n", " ").splitlines()
1638+
old_lines_unique = [line for line in old_lines if line not in new_lines]
1639+
new_lines_unique = [line for line in new_lines if line not in old_lines]
1640+
if old_lines_unique or new_lines_unique:
1641+
logger.warning(
1642+
f"{stix_id} - {attack_id} has a description change "
1643+
"without the version being incremented or the last modified date changing"
1644+
)
1645+
return True
16451646

16461647
# doesn't meet the definintion of a patch change
16471648
return False

0 commit comments

Comments
 (0)