Skip to content

Commit

Permalink
fix: check if the index exists before checking it's properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Jan 24, 2024
1 parent 6fb7e14 commit 0721772
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public long getIndexStats(
if (database != null && database instanceof ODatabaseDocumentInternal) {
ODatabaseDocumentInternal db = (ODatabaseDocumentInternal) database;
OIndex idx = db.getMetadata().getIndexManagerInternal().getIndex(db, indexName);
if (idx.isUnique() && (idx.getDefinition().getFields().size() == params) && !range) {
if (idx != null && idx.isUnique() && (idx.getDefinition().getFields().size() == params) && !range) {
return 1;
}
}
Expand Down

0 comments on commit 0721772

Please sign in to comment.