Avoid dereferencing a null field
This commit is contained in:
parent
1a1b953471
commit
b87db07152
@ -385,13 +385,13 @@ class SimpleSortedIndex : public Index {
|
||||
override {
|
||||
auto value = document.Get(field_);
|
||||
if (value == nullptr) {
|
||||
// null
|
||||
if (!EncodeJSONPrimitive(JSONDocument(JSONDocument::kNull), key)) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
if (!EncodeJSONPrimitive(*value, key)) {
|
||||
assert(false);
|
||||
} else {
|
||||
if (!EncodeJSONPrimitive(*value, key)) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual const Comparator* GetComparator() const override {
|
||||
|
Loading…
Reference in New Issue
Block a user