File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -151,23 +151,21 @@ bool CIPCSocket::mainThreadParseRequest() {
151151
152152 std::string args = copy.substr (spaceSeparator + 1 );
153153 unsigned long long kelvin = g_pHyprsunset->KELVIN ;
154- if (args[ 0 ] == ' + ' || args[ 0 ] == ' - ' ) {
155- try {
154+ try {
155+ if (args[ 0 ] == ' + ' || args[ 0 ] == ' - ' ) {
156156 if (args[0 ] == ' -' )
157157 kelvin -= std::stoull (args.substr (1 ));
158158 else
159159 kelvin += std::stoull (args.substr (1 ));
160- } catch (std::exception& e) {
161- m_szReply = " Invalid temperature (should be in range 1000-20000)" ;
162- return false ;
163- }
164-
165- kelvin = std::clamp (kelvin, 1000ull , 20000ull );
166- } else
167- kelvin = std::stoull (args);
168-
160+ kelvin = std::clamp (kelvin, 1000ull , 20000ull );
161+ } else
162+ kelvin = std::stoull (args);
163+ } catch (std::exception& e) {
164+ m_szReply = " Invalid temperature (should be an integer in range 1000-20000)" ;
165+ return false ;
166+ }
169167 if (kelvin < 1000 || kelvin > 20000 ) {
170- m_szReply = " Invalid temperature (should be in range 1000-20000)" ;
168+ m_szReply = " Invalid temperature (should be an integer in range 1000-20000)" ;
171169 return false ;
172170 }
173171
You can’t perform that action at this time.
0 commit comments