mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 12:32:01 +08:00
Throw a custom exception if Print::delete_object() gets an out-of-range identifier.
This commit is contained in:
parent
d56ce183a4
commit
d34d0ea6ea
@ -77,6 +77,8 @@ void
|
||||
Print::delete_object(size_t idx)
|
||||
{
|
||||
PrintObjectPtrs::iterator i = this->objects.begin() + idx;
|
||||
if (i >= this->objects.end())
|
||||
throw InvalidObjectException();
|
||||
|
||||
// before deleting object, invalidate all of its steps in order to
|
||||
// invalidate all of the dependent ones in Print
|
||||
|
@ -16,8 +16,12 @@
|
||||
#include "SlicingAdaptive.hpp"
|
||||
#include "LayerHeightSpline.hpp"
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class InvalidObjectException : public std::exception {};
|
||||
|
||||
class Print;
|
||||
class PrintObject;
|
||||
class ModelObject;
|
||||
|
Loading…
x
Reference in New Issue
Block a user