osdict: Prevent traceback in the logs when detection fails

This commit is contained in:
Cole Robinson 2014-04-25 16:31:00 -04:00
parent b1236c1af0
commit 6ed988ebfc

View File

@ -593,6 +593,6 @@ def lookup_os_by_media(location):
loader = _get_os_loader()
media = libosinfo.Media.create_from_location(location, None)
ret = loader.get_db().guess_os_from_media(media)
if ret and len(ret) > 0:
if ret and len(ret) > 0 and ret[0]:
return ret[0].get_short_id()
return None