FIX:add protection for null pointer

jira: none
Change-Id: I9a9231bab893f5d2afa008f65165269ae176c962
This commit is contained in:
zhou.xu 2024-10-10 14:35:11 +08:00 committed by Lane.Wei
parent 6472fbdc6a
commit f27a713aaf
2 changed files with 5 additions and 1 deletions

View File

@ -496,6 +496,10 @@ void GLGizmoRotate3D::on_set_state()
void GLGizmoRotate3D::data_changed(bool is_serializing) { void GLGizmoRotate3D::data_changed(bool is_serializing) {
const Selection &selection = m_parent.get_selection(); const Selection &selection = m_parent.get_selection();
const GLVolume * volume = selection.get_first_volume(); const GLVolume * volume = selection.get_first_volume();
if (volume == nullptr) {
m_last_volume = nullptr;
return;
}
if (m_last_volume != volume) { if (m_last_volume != volume) {
m_last_volume = volume; m_last_volume = volume;
Geometry::Transformation tran; Geometry::Transformation tran;

View File

@ -1500,7 +1500,7 @@ void GLGizmoSVG::draw_filename()
draw(get_icon(m_icons, IconType::bake, IconState::hovered)); draw(get_icon(m_icons, IconType::bake, IconState::hovered));
ImGui::SameLine(); ImGui::SameLine();
// TRN: An menu option to convert the SVG into an unmodifiable model part. // TRN: An menu option to convert the SVG into an unmodifiable model part.
if (ImGui::Selectable(_L("Bake to model").c_str())) { if (ImGui::Selectable(_u8L("Bake to model").c_str())) {
m_volume->emboss_shape.reset(); m_volume->emboss_shape.reset();
close(); close();
} else if (ImGui::IsItemHovered()) { } else if (ImGui::IsItemHovered()) {