aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/device.cc b/device.cc
index 9cf4dc3..20bb0c6 100644
--- a/device.cc
+++ b/device.cc
@@ -233,7 +233,10 @@ namespace {
auto pInfo = hid_enumerate(vendor_id, 0);
auto pInfo_ = pInfo;
while (pInfo != nullptr){
- auto deviceModel = product_id_to_model(vendor_id, pInfo->product_id);
+ if (pInfo->path == nullptr || pInfo->serial_number == nullptr) {
+ continue;
+ }
+ auto deviceModel = product_id_to_model(vendor_id, pInfo->product_id);
if (deviceModel.has_value()) {
std::string path(pInfo->path);
std::wstring serialNumberW(pInfo->serial_number);