From 0721772b7f7ac86f90d4a630602244721fc73598 Mon Sep 17 00:00:00 2001 From: Tglman Date: Wed, 24 Jan 2024 17:09:00 +0100 Subject: [PATCH] fix: check if the index exists before checking it's properties --- .../orientechnologies/orient/core/sql/executor/OQueryStats.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OQueryStats.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OQueryStats.java index d5e2948a5ca..01cc4a8b6d5 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OQueryStats.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OQueryStats.java @@ -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; } }