Skip to content

Commit

Permalink
runners: jlink: Fix NoneType object error
Browse files Browse the repository at this point in the history
The commit 221199e 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 <[email protected]>
  • Loading branch information
ngphibang authored and dleach02 committed Oct 16, 2024
1 parent 18fb3f9 commit 829c03b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/west_commands/runners/jlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 829c03b

Please sign in to comment.