Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/minja/minja.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ class Value : public std::enable_shared_from_this<Value> {
}
}
void erase(size_t index) {
if (array_) throw std::runtime_error("Value is not an array: " + dump());
if (!array_) throw std::runtime_error("Value is not an array: " + dump());
array_->erase(array_->begin() + index);
}
void erase(const std::string & key) {
if (object_) throw std::runtime_error("Value is not an object: " + dump());
if (!object_) throw std::runtime_error("Value is not an object: " + dump());
object_->erase(key);
}
const Value& at(const Value & index) const {
Expand Down
Loading