Skip to content

Commit

Permalink
fix(load fallbackvalue): Avoid conversion exception if string is inva…
Browse files Browse the repository at this point in the history
…lid (#169)
  • Loading branch information
Slider0007 authored Oct 10, 2024
1 parent 27c1094 commit 7a3219c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/components/mainprocess_ctrl/ClassFlowPostProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,8 @@ bool ClassFlowPostProcessing::loadFallbackValue(void)
// Fallback value valid
else {
sequence->isFallbackValueValid = true;
sequence->fallbackValue = stod(std::string(cValue));
char *pEnd = NULL;
sequence->fallbackValue = strtod(cValue, &pEnd);
sequence->sFallbackValue = to_stringWithPrecision(sequence->fallbackValue, sequence->decimalPlaceCount + 1); // Keep one digit more
LogFile.writeToFile(ESP_LOG_INFO, TAG, sequence->sequenceName + ": Fallback value valid | Time: " + std::string(cTime));
}
Expand Down

0 comments on commit 7a3219c

Please sign in to comment.