mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
FIX: crash when open 3mf file
the volume type is unreasonable, causing the array to go out of bounds Change-Id: I316b05f277f894b1fd32cda3eca29340d988e01e
This commit is contained in:
parent
60f524167d
commit
6f141ea740
1 changed files with 2 additions and 1 deletions
|
@ -495,8 +495,9 @@ wxDataViewItem ObjectDataViewModel::AddOutsidePlate(bool refresh)
|
|||
|
||||
void ObjectDataViewModel::UpdateBitmapForNode(ObjectDataViewModelNode *node)
|
||||
{
|
||||
bool is_volume_node = node->GetType() & itVolume;
|
||||
int vol_type = static_cast<int>(node->GetVolumeType());
|
||||
bool is_volume_node = vol_type >= 0;
|
||||
is_volume_node &= (vol_type >= int(ModelVolumeType::MODEL_PART) && vol_type <= int(ModelVolumeType::SUPPORT_ENFORCER));
|
||||
|
||||
if (!node->has_warning_icon() && !node->has_lock()) {
|
||||
node->SetBitmap(is_volume_node ? m_volume_bmps.at(vol_type) : m_empty_bmp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue