Merge pull request #165 from cmaglie/fix_darwin_enumerator

Fix some rare MacOSX USB port enumerator failures
This commit is contained in:
Cristian Maglie
2023-09-14 15:31:58 +02:00
committed by GitHub

View File

@@ -97,8 +97,8 @@ func getAllServices(serviceType string) ([]io_object_t, error) {
services = append(services, service) services = append(services, service)
continue continue
} }
// If iterator is still valid return the result // If the list of services is empty or the iterator is still valid return the result
if i.IsValid() { if len(services) == 0 || i.IsValid() {
return services, nil return services, nil
} }
// Otherwise empty the result and retry // Otherwise empty the result and retry