diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py index 548c9fce1..8bb89ce5a 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py @@ -73,13 +73,13 @@ def set_data_file_in_config(config, file): @staticmethod def get_human_readable(device, property): try: - value = getattr(device, property) - if value.has_value(): - return value.value() - else: - return f"Unknown ({value.no_value_message()})" - except: + value = device.get(property) + except Exception: return "Property not found in data file" + if value and value.has_value(): + return value.value() + else: + return f"Unknown ({value.no_value_message()})" @staticmethod def get_resource_key():