Use .at() instead of [] because that'll throw an exception if out of bounds instead of a hard-to-find memory crash.

This commit is contained in:
Joseph Lenox 2018-05-06 19:38:11 -05:00 committed by Joseph Lenox
parent 3d57da105d
commit 8ba681538d

View File

@ -199,8 +199,8 @@ std::vector<int> Plater::load_file(const wxString& file, const int obj_idx_to_lo
} }
for (const auto &j : obj_idx) { for (const auto &j : obj_idx) {
this->objects[j].input_file = file; this->objects.at(j).input_file = file;
this->objects[j].input_file_obj_idx = i++; this->objects.at(j).input_file_obj_idx = i++;
} }
GetFrame()->statusbar->SetStatusText(_("Loaded ") + input_file.GetName()); GetFrame()->statusbar->SetStatusText(_("Loaded ") + input_file.GetName());