You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2022/12/18 16:03:03 UTC

[jackrabbit-oak] branch trunk updated: OAK-10038: CompositeStoreIT: add workaround for potential NPE in test (#797)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b07057dd0b OAK-10038: CompositeStoreIT: add workaround for potential NPE in test (#797)
b07057dd0b is described below

commit b07057dd0b00372be48a5a8d96b347bd6ecb1cf8
Author: Julian Reschke <re...@apache.org>
AuthorDate: Sun Dec 18 17:02:57 2022 +0100

    OAK-10038: CompositeStoreIT: add workaround for potential NPE in test (#797)
---
 .../oak/composite/checks/NodeTypeDefinitionNodeStoreChecker.java     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/oak-store-composite/src/main/java/org/apache/jackrabbit/oak/composite/checks/NodeTypeDefinitionNodeStoreChecker.java b/oak-store-composite/src/main/java/org/apache/jackrabbit/oak/composite/checks/NodeTypeDefinitionNodeStoreChecker.java
index 9803e5cb82..5df639fb67 100644
--- a/oak-store-composite/src/main/java/org/apache/jackrabbit/oak/composite/checks/NodeTypeDefinitionNodeStoreChecker.java
+++ b/oak-store-composite/src/main/java/org/apache/jackrabbit/oak/composite/checks/NodeTypeDefinitionNodeStoreChecker.java
@@ -75,6 +75,11 @@ public class NodeTypeDefinitionNodeStoreChecker implements MountedNodeStoreCheck
         NodeBuilder rootBuilder = new ReadOnlyBuilder(root); // prevent accidental changes
         
         String primary = root.getName(JCR_PRIMARYTYPE);
+        // workaround until https://issues.apache.org/jira/browse/OAK-9863 is fixed
+        if (primary == null) {
+            // no primary type for root node found (probably empty segment store used for testing)
+            return false;
+        }
         Iterable<String> mixins = root.getNames(JCR_MIXINTYPES);
         try {
             Set<String> checkNodeTypeNames = context.getAllNodeTypeNames();