Skip to content

Commit ba5cf3d

Browse files
committed
fix: handle new detection strategy STIX bundles that have altered how datasources work
1 parent 46aebcd commit ba5cf3d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mitreattack/attackToExcel/stixToDf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,13 @@ def relationshipsToDf(src, relatedType=None):
974974
relationship_rows.append(row)
975975

976976
citations = get_citations(relationships)
977-
relationships = pd.DataFrame(relationship_rows).sort_values(
977+
978+
relationship_df = pd.DataFrame(relationship_rows)
979+
if relationship_df.empty or "mapping type" not in relationship_df.columns:
980+
logger.warning(f"No relationships found for relatedType={relatedType}. Returning empty dataframe.")
981+
return {}
982+
983+
relationships = relationship_df.sort_values(
978984
[
979985
"mapping type",
980986
"source type",

0 commit comments

Comments
 (0)