aboutsummaryrefslogtreecommitdiff
path: root/icing/index/integer-section-indexing-handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'icing/index/integer-section-indexing-handler.cc')
-rw-r--r--icing/index/integer-section-indexing-handler.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/icing/index/integer-section-indexing-handler.cc b/icing/index/integer-section-indexing-handler.cc
index d201a1a..584f028 100644
--- a/icing/index/integer-section-indexing-handler.cc
+++ b/icing/index/integer-section-indexing-handler.cc
@@ -43,6 +43,11 @@ libtextclassifier3::Status IntegerSectionIndexingHandler::Handle(
bool recovery_mode, PutDocumentStatsProto* put_document_stats) {
// TODO(b/259744228): set integer indexing latency and other stats
+ if (!IsDocumentIdValid(document_id)) {
+ return absl_ports::InvalidArgumentError(
+ IcingStringUtil::StringPrintf("Invalid DocumentId %d", document_id));
+ }
+
if (integer_index_.last_added_document_id() != kInvalidDocumentId &&
document_id <= integer_index_.last_added_document_id()) {
if (recovery_mode) {