From 8ba681538d785b19258a163ae9a149ae25ed29f0 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 6 May 2018 19:38:11 -0500 Subject: [PATCH] Use .at() instead of [] because that'll throw an exception if out of bounds instead of a hard-to-find memory crash. --- src/GUI/Plater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index d94e51005..994adbe44 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -199,8 +199,8 @@ std::vector Plater::load_file(const wxString& file, const int obj_idx_to_lo } for (const auto &j : obj_idx) { - this->objects[j].input_file = file; - this->objects[j].input_file_obj_idx = i++; + this->objects.at(j).input_file = file; + this->objects.at(j).input_file_obj_idx = i++; } GetFrame()->statusbar->SetStatusText(_("Loaded ") + input_file.GetName());