Update json_value.cpp

This commit is contained in:
Billy Donahue 2021-03-18 04:44:30 -04:00 committed by GitHub
parent 1a2da44e06
commit 9a716e9622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1398,7 +1398,7 @@ String Value::Comments::get(CommentPlacement slot) const {
} }
void Value::Comments::set(CommentPlacement slot, String comment) { void Value::Comments::set(CommentPlacement slot, String comment) {
if (slot < CommentPlacement::numberOfCommentPlacement) if (slot >= CommentPlacement::numberOfCommentPlacement)
return; return;
if (!ptr_) if (!ptr_)
ptr_ = std::unique_ptr<Array>(new Array()); ptr_ = std::unique_ptr<Array>(new Array());