From ca4067ad665e63b289cc416565b88e9c32b51417 Mon Sep 17 00:00:00 2001 From: Tglman Date: Tue, 19 Sep 2023 12:14:53 +0100 Subject: [PATCH] fix: add check to avoid to try locking not existing ridbags --- .../impl/local/OAbstractPaginatedStorage.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java index dba8f2c5c28..a3d31a348e5 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OAbstractPaginatedStorage.java @@ -6339,15 +6339,17 @@ private void lockRidBags( for (final Map.Entry entry : indexes.entrySet()) { final String indexName = entry.getKey(); final OIndexInternal index = entry.getValue().resolveAssociatedIndex(indexName, manager, db); - try { - OBaseIndexEngine engine = getIndexEngine(index.getIndexId()); + if (index != null) { + try { + OBaseIndexEngine engine = getIndexEngine(index.getIndexId()); - if (!index.isUnique() && engine.hasRidBagTreesSupport()) { - atomicOperationsManager.acquireExclusiveLockTillOperationComplete( - atomicOperation, OIndexRIDContainerSBTree.generateLockName(indexName)); + if (!index.isUnique() && engine.hasRidBagTreesSupport()) { + atomicOperationsManager.acquireExclusiveLockTillOperationComplete( + atomicOperation, OIndexRIDContainerSBTree.generateLockName(indexName)); + } + } catch (OInvalidIndexEngineIdException e) { + throw logAndPrepareForRethrow(e, false); } - } catch (OInvalidIndexEngineIdException e) { - throw logAndPrepareForRethrow(e, false); } } }