Don't crash when an extracted identity value isn't a string (#3039)

This commit is contained in:
Sushanth012
2026-08-30 22:07:34 +02:00
committed by GitHub
parent adf8cfd9b1
commit f22a780679
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ def get_dict_ascii_tree(items, prepend="", new_line=True):
if isinstance(item, tuple):
field_name, field_value = item
if field_value.startswith("['"):
if isinstance(field_value, str) and field_value.startswith("['"):
is_last_item = num == len(items) - 1
prepend_symbols = " " * 3 if is_last_item else f" {skip_result} "
data = ascii_data_display(field_value)
+4
View File
@@ -191,6 +191,10 @@ def test_get_dict_ascii_tree():
)
def test_get_dict_ascii_tree_handles_non_string_values():
assert get_dict_ascii_tree([('uid', 42)], new_line=False) == '└─uid: 42'
def test_get_match_ratio():
fun = get_match_ratio(["test", "maigret", "username"])