@@ -79,20 +79,38 @@ static void upsert_device(std::vector<BacklightDevice>& devices, udev_device* de
7979 });
8080 if (found != devices.end ()) {
8181 if (actual != nullptr ) {
82- try { found->set_actual (std::stoi (actual)); } catch (const std::exception&) {}
82+ try {
83+ found->set_actual (std::stoi (actual));
84+ } catch (const std::exception&) {
85+ }
8386 }
8487 if (max != nullptr ) {
85- try { found->set_max (std::stoi (max)); } catch (const std::exception&) {}
88+ try {
89+ found->set_max (std::stoi (max));
90+ } catch (const std::exception&) {
91+ }
8692 }
8793 if (power != nullptr ) {
88- try { found->set_powered (std::stoi (power) == 0 ); } catch (const std::exception&) {}
94+ try {
95+ found->set_powered (std::stoi (power) == 0 );
96+ } catch (const std::exception&) {
97+ }
8998 }
9099 } else {
91100 int actual_int = 0 , max_int = 0 ;
92101 bool power_bool = true ;
93- try { if (actual != nullptr ) actual_int = std::stoi (actual); } catch (const std::exception&) {}
94- try { if (max != nullptr ) max_int = std::stoi (max); } catch (const std::exception&) {}
95- try { if (power != nullptr ) power_bool = std::stoi (power) == 0 ; } catch (const std::exception&) {}
102+ try {
103+ if (actual != nullptr ) actual_int = std::stoi (actual);
104+ } catch (const std::exception&) {
105+ }
106+ try {
107+ if (max != nullptr ) max_int = std::stoi (max);
108+ } catch (const std::exception&) {
109+ }
110+ try {
111+ if (power != nullptr ) power_bool = std::stoi (power) == 0 ;
112+ } catch (const std::exception&) {
113+ }
96114 devices.emplace_back (name, actual_int, max_int, power_bool);
97115 }
98116}
0 commit comments