From cebd45e3d7ce16fb8e11574cc29eccf306c9b19b Mon Sep 17 00:00:00 2001 From: baila Date: Fri, 12 Jan 2024 17:39:37 +0530 Subject: [PATCH] Addressing review comments. --- hardware_interface/src/lexical_casts.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hardware_interface/src/lexical_casts.cpp b/hardware_interface/src/lexical_casts.cpp index 3e795563d7..940beb6d0f 100644 --- a/hardware_interface/src/lexical_casts.cpp +++ b/hardware_interface/src/lexical_casts.cpp @@ -29,7 +29,7 @@ std::optional stod(const std::string & s) stream >> result; if (stream.fail() || !stream.eof()) { - throw std::invalid_argument("Failed converting string to real number"); + return std::nullopt; } return result; #else @@ -40,9 +40,7 @@ std::optional stod(const std::string & s) { return result_value; } - return std::nullopt; - ; #endif } } // namespace impl