runners: jlink: Fix NoneType object error

The commit 221199e15b 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 <phibang.nguyen@nxp.com>
This commit is contained in:
Phi Bang Nguyen 2024-10-15 22:46:00 +02:00 committed by David Leach
parent 18fb3f9a32
commit 829c03bcdc
1 changed files with 1 additions and 1 deletions

View File

@ -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):