mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fixed crash on "stoi argument out of range" from SpinConrol (SPE-847)
This commit is contained in:
parent
aa0737fa5e
commit
8756a14557
1 changed files with 8 additions and 2 deletions
|
@ -464,8 +464,14 @@ void SpinCtrl::BUILD() {
|
||||||
// # As a workaround, we get the new value from $event->GetString and store
|
// # As a workaround, we get the new value from $event->GetString and store
|
||||||
// # here temporarily so that we can return it from $self->get_value
|
// # here temporarily so that we can return it from $self->get_value
|
||||||
std::string value = e.GetString().utf8_str().data();
|
std::string value = e.GetString().utf8_str().data();
|
||||||
if (is_matched(value, "^\\-?\\d+$"))
|
if (is_matched(value, "^\\-?\\d+$")) {
|
||||||
tmp_value = std::stoi(value);
|
try {
|
||||||
|
tmp_value = std::stoi(value);
|
||||||
|
}
|
||||||
|
catch (const std::exception & /* e */) {
|
||||||
|
tmp_value = -9999;
|
||||||
|
}
|
||||||
|
}
|
||||||
else tmp_value = -9999;
|
else tmp_value = -9999;
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
propagate_value();
|
propagate_value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue