From ebfc45e55010c11f03e811e0194da5bbe4ef00e7 Mon Sep 17 00:00:00 2001 From: Martin Guenther Date: Wed, 21 Dec 2016 17:51:26 +0100 Subject: [PATCH] Don't connect to any device if URI cannot be resolved Fixes #35. --- src/openni2_driver.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openni2_driver.cpp b/src/openni2_driver.cpp index 6e1d62c4..02d2f890 100644 --- a/src/openni2_driver.cpp +++ b/src/openni2_driver.cpp @@ -716,10 +716,11 @@ std::string OpenNI2Driver::resolveDeviceURI(const std::string& device_id) throw( } } } - return matched_uri; + if (match_found) + return matched_uri; + else + return "INVALID"; } - - return "INVALID"; } void OpenNI2Driver::initDevice()