Avoid dereferencing a null field

main
Nik Bougalis 10 years ago
parent 1a1b953471
commit b87db07152
  1. 4
      utilities/document/document_db.cc

@ -385,15 +385,15 @@ class SimpleSortedIndex : public Index {
override {
auto value = document.Get(field_);
if (value == nullptr) {
// null
if (!EncodeJSONPrimitive(JSONDocument(JSONDocument::kNull), key)) {
assert(false);
}
}
} else {
if (!EncodeJSONPrimitive(*value, key)) {
assert(false);
}
}
}
virtual const Comparator* GetComparator() const override {
return BytewiseComparator();
}

Loading…
Cancel
Save