Skip to content

Commit 4b200bc

Browse files
committed
fix: change return value to "None" in case getattr returns None to prevent error
1 parent 43c2dda commit 4b200bc

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy