From 829c03bcdca378fa2fa55484d16a190d379f754c Mon Sep 17 00:00:00 2001 From: Phi Bang Nguyen Date: Tue, 15 Oct 2024 22:46:00 +0200 Subject: [PATCH] runners: jlink: Fix NoneType object error The commit 221199e15b85a070b3d81709eee3d533c9f99967 presents a bug that makes west flash failed with error. AttributeError: 'NoneType' object has no attribute 'startswith' In function is_tunnel(), tunnel may contain None and has no attribute "startswith". Fix it. Signed-off-by: Phi Bang Nguyen --- scripts/west_commands/runners/jlink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/jlink.py b/scripts/west_commands/runners/jlink.py index ce500490349238..21a510e2721f88 100644 --- a/scripts/west_commands/runners/jlink.py +++ b/scripts/west_commands/runners/jlink.py @@ -37,7 +37,7 @@ def is_ip(ip): return True def is_tunnel(tunnel): - return tunnel.startswith("tunnel:") + return tunnel.startswith("tunnel:") if tunnel else False class ToggleAction(argparse.Action):