Skip to content

Commit 7b49591

Browse files
committed
Added in safety check if details_txt is None
1 parent aafe614 commit 7b49591

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/detect_targets.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,21 @@ def main():
103103
def get_interface_version(mount_point):
104104
""" Function returns interface version from the target mounted on the specified mount point
105105
106-
mount_point can be acquired via the following:
107-
muts = get_autodetected_MUTS_list()
108-
for mut in muts.values():
109-
mount_point = mut['disk']
106+
mount_point can be acquired via the following:
107+
muts = get_autodetected_MUTS_list()
108+
for mut in muts.values():
109+
mount_point = mut['disk']
110110
111111
@param mount_point Name of disk where platform is connected to host machine.
112112
"""
113113
if get_module_avail('mbed_lstools'):
114114
mbeds = mbed_lstools.create()
115115
details_txt = mbeds.get_details_txt(mount_point)
116116

117+
if (details_txt is None):
118+
details_txt = {}
119+
120+
117121
if 'Interface Version' in details_txt:
118122
return details_txt['Interface Version']
119123

0 commit comments

Comments
 (0)