Skip to content

Commit 3f86d36

Browse files
pinxuenejch
authored andcommitted
fix: change return value to "None" in case getattr returns None to prevent error
1 parent 43b369f commit 3f86d36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitlab/v4/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def display_dict(d: Dict[str, Any], padding: int) -> None:
490490
id = getattr(obj, obj._id_attr)
491491
print(f"{obj._id_attr.replace('_', '-')}: {id}")
492492
if obj._repr_attr:
493-
value = getattr(obj, obj._repr_attr, "None")
493+
value = getattr(obj, obj._repr_attr, "None") or "None"
494494
value = value.replace("\r", "").replace("\n", " ")
495495
# If the attribute is a note (ProjectCommitComment) then we do
496496
# some modifications to fit everything on one line

0 commit comments

Comments
 (0)