We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d57c98 + 79f1c2d commit 51a4a07Copy full SHA for 51a4a07
include/minja/minja.hpp
@@ -367,11 +367,11 @@ class Value : public std::enable_shared_from_this<Value> {
367
}
368
369
void erase(size_t index) {
370
- if (array_) throw std::runtime_error("Value is not an array: " + dump());
+ if (!array_) throw std::runtime_error("Value is not an array: " + dump());
371
array_->erase(array_->begin() + index);
372
373
void erase(const std::string & key) {
374
- if (object_) throw std::runtime_error("Value is not an object: " + dump());
+ if (!object_) throw std::runtime_error("Value is not an object: " + dump());
375
object_->erase(key);
376
377
const Value& at(const Value & index) const {
0 commit comments