mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-03 21:20:43 +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)
|
Print::delete_object(size_t idx)
|
||||||
{
|
{
|
||||||
PrintObjectPtrs::iterator i = this->objects.begin() + 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
|
// before deleting object, invalidate all of its steps in order to
|
||||||
// invalidate all of the dependent ones in Print
|
// invalidate all of the dependent ones in Print
|
||||||
|
@ -16,8 +16,12 @@
|
|||||||
#include "SlicingAdaptive.hpp"
|
#include "SlicingAdaptive.hpp"
|
||||||
#include "LayerHeightSpline.hpp"
|
#include "LayerHeightSpline.hpp"
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
class InvalidObjectException : public std::exception {};
|
||||||
|
|
||||||
class Print;
|
class Print;
|
||||||
class PrintObject;
|
class PrintObject;
|
||||||
class ModelObject;
|
class ModelObject;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user