Added in safety check if details_txt is None

pull/5077/head
David Walters 2017-09-15 16:00:20 +01:00
parent aafe61414e
commit 7b4959125f
1 changed files with 8 additions and 4 deletions

View File

@ -103,10 +103,10 @@ def main():
def get_interface_version(mount_point):
""" Function returns interface version from the target mounted on the specified mount point
mount_point can be acquired via the following:
muts = get_autodetected_MUTS_list()
for mut in muts.values():
mount_point = mut['disk']
mount_point can be acquired via the following:
muts = get_autodetected_MUTS_list()
for mut in muts.values():
mount_point = mut['disk']
@param mount_point Name of disk where platform is connected to host machine.
"""
@ -114,6 +114,10 @@ def get_interface_version(mount_point):
mbeds = mbed_lstools.create()
details_txt = mbeds.get_details_txt(mount_point)
if (details_txt is None):
details_txt = {}
if 'Interface Version' in details_txt:
return details_txt['Interface Version']