mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 16:27:54 -06:00
FIX: fix some crashes
Change-Id: Iab830fd58c2a6abc77787cba95d530f9b53d7b52
This commit is contained in:
parent
d76edece9f
commit
9352f34ad0
2 changed files with 9 additions and 3 deletions
|
@ -3186,7 +3186,7 @@ void ObjectList::part_selection_changed()
|
||||||
for (auto item : sels) {
|
for (auto item : sels) {
|
||||||
int obj_idx = m_objects_model->GetObjectIdByItem(item);
|
int obj_idx = m_objects_model->GetObjectIdByItem(item);
|
||||||
const ModelObject *obj = object(obj_idx);
|
const ModelObject *obj = object(obj_idx);
|
||||||
if (obj->is_cut()) {
|
if (obj && obj->is_cut()) {
|
||||||
if (cut_objects.find(obj->cut_id) == cut_objects.end())
|
if (cut_objects.find(obj->cut_id) == cut_objects.end())
|
||||||
cut_objects[obj->cut_id] = std::set<int>{obj_idx};
|
cut_objects[obj->cut_id] = std::set<int>{obj_idx};
|
||||||
else
|
else
|
||||||
|
|
|
@ -1633,7 +1633,10 @@ void NotificationManager::push_validate_error_notification(StringObjectException
|
||||||
void NotificationManager::push_slicing_error_notification(const std::string &text, std::vector<ModelObject const *> objs)
|
void NotificationManager::push_slicing_error_notification(const std::string &text, std::vector<ModelObject const *> objs)
|
||||||
{
|
{
|
||||||
std::vector<ObjectID> ids;
|
std::vector<ObjectID> ids;
|
||||||
for (auto optr : objs) { ids.push_back(optr->id()); }
|
for (auto optr : objs) {
|
||||||
|
if (optr)
|
||||||
|
ids.push_back(optr->id());
|
||||||
|
}
|
||||||
auto callback = !objs.empty() ? [ids](wxEvtHandler *) {
|
auto callback = !objs.empty() ? [ids](wxEvtHandler *) {
|
||||||
auto & objects = wxGetApp().model().objects;
|
auto & objects = wxGetApp().model().objects;
|
||||||
std::vector<ObjectVolumeID> ovs;
|
std::vector<ObjectVolumeID> ovs;
|
||||||
|
@ -1650,7 +1653,10 @@ void NotificationManager::push_slicing_error_notification(const std::string &tex
|
||||||
auto link = callback ? _u8L("Jump to") : "";
|
auto link = callback ? _u8L("Jump to") : "";
|
||||||
if (!objs.empty()) {
|
if (!objs.empty()) {
|
||||||
link += " [";
|
link += " [";
|
||||||
for (auto obj : objs) { link += obj->name + ", "; }
|
for (auto obj : objs) {
|
||||||
|
if (obj)
|
||||||
|
link += obj->name + ", ";
|
||||||
|
}
|
||||||
if (!objs.empty()) {
|
if (!objs.empty()) {
|
||||||
link.pop_back();
|
link.pop_back();
|
||||||
link.pop_back();
|
link.pop_back();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue