diff --git a/dist/tools/usb-serial/ttys.py b/dist/tools/usb-serial/ttys.py index fbf1ff904099..38b6ed3415ac 100755 --- a/dist/tools/usb-serial/ttys.py +++ b/dist/tools/usb-serial/ttys.py @@ -186,7 +186,7 @@ def print_results(args, ttys): line = "" for fmt in args.format: item = tty[fmt] - if item.rfind(args.format_sep) >= 0: + if item is not None and item.rfind(args.format_sep) >= 0: # item contains separator --> quote it # using json.dumps to also escape quotation chars and other # unsafe stuff