scripts: west_commands: runners: Fix jlink is_ip

Commit f987e8c6f0a49b04a1184b1a36612612482e3d24 introduced a regression
where the is_ip check fails if no --id is passed as an argument.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-10-24 09:07:58 +02:00 committed by Carles Cufí
parent 1689eaf6a4
commit 1759967597

View file

@ -30,6 +30,8 @@ DEFAULT_JLINK_GDB_PORT = 2331
DEFAULT_JLINK_RTT_PORT = 19021 DEFAULT_JLINK_RTT_PORT = 19021
def is_ip(ip): def is_ip(ip):
if not ip:
return False
try: try:
ipaddress.ip_address(ip.split(':')[0]) ipaddress.ip_address(ip.split(':')[0])
except ValueError: except ValueError: