From 24a91d7420b4d723b8fab5483695f2ff490bc7a1 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 23 Jan 2023 13:23:50 +0100 Subject: [PATCH] Fixed is_nil(size_t) when checking out-of-range element --- src/libslic3r/Config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index ef3dc32c81..23be26ee71 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -776,7 +776,7 @@ public: static int nil_value() { return std::numeric_limits::max(); } // A scalar is nil, or all values of a vector are nil. bool is_nil() const override { for (auto v : this->values) if (v != nil_value()) return false; return true; } - bool is_nil(size_t idx) const override { return this->values[idx] == nil_value(); } + bool is_nil(size_t idx) const override { return values[idx < this->values.size() ? idx : 0] == nil_value(); } std::string serialize() const override {