diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 2a53138bc..6511aaab3 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -1175,7 +1175,7 @@ bool Value::removeMember(const char* key, const char* cend, Value* removed) ObjectValues::iterator it = value_.map_->find(actualKey); if (it == value_.map_->end()) return false; - *removed = it->second; + if (removed) *removed = it->second; value_.map_->erase(it); return true; } @@ -1212,7 +1212,7 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) { if (it == value_.map_->end()) { return false; } - *removed = it->second; + if (removed) *removed = it->second; ArrayIndex oldSize = size(); // shift left all items left, into the place of the "removed" for (ArrayIndex i = index; i < (oldSize - 1); ++i){