mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-17 16:55:41 -06:00
FIX: CLI: fix the size related issue in set_with_restore_2
jira: no-jira Change-Id: I5b9b5dd3ae2eac63e9f494fd7b7ab5d4d38dbac7 (cherry picked from commit 030ebd1a3515a7d3dbdf3c6cfb77ff0b6b764f2e)
This commit is contained in:
parent
8e9281d68e
commit
41bfd5b8c2
1 changed files with 9 additions and 3 deletions
|
|
@ -514,11 +514,17 @@ public:
|
|||
//backup original ones
|
||||
std::vector<T> backup_values = this->values;
|
||||
|
||||
if (this->values.size() < (start+len))
|
||||
if (this->values.size() < start) {
|
||||
throw ConfigurationError("ConfigOptionVector::set_with_restore_2(): invalid size found");
|
||||
}
|
||||
else {
|
||||
if (this->values.size() < start + len)
|
||||
len = this->values.size() - start;
|
||||
|
||||
//erase the original ones
|
||||
this->values.erase(this->values.begin() + start, this->values.begin() + start + len);
|
||||
//erase the original ones
|
||||
if (len > 0)
|
||||
this->values.erase(this->values.begin() + start, this->values.begin() + start + len);
|
||||
}
|
||||
|
||||
// Assign the new value from the rhs vector.
|
||||
auto other = static_cast<const ConfigOptionVector<T>*>(rhs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue