jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r477564 - /jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java
Date Tue, 21 Nov 2006 08:07:13 GMT
Author: angela
Date: Tue Nov 21 00:07:12 2006
New Revision: 477564

URL: http://svn.apache.org/viewvc?view=rev&rev=477564
Log:
add check for itemPath within search not being null.

Modified:
    jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java

Modified: jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java?view=diff&rev=477564&r1=477563&r2=477564
==============================================================================
--- jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java
(original)
+++ jackrabbit/trunk/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/search/SearchResourceImpl.java
Tue Nov 21 00:07:12 2006
@@ -120,7 +120,7 @@
 
         // test if query is defined by requested repository node
         String itemPath = locator.getRepositoryPath();
-        if (!rootNode.getPath().equals(itemPath)) {
+        if (itemPath != null && !rootNode.getPath().equals(itemPath)) {
             String qNodeRelPath = itemPath.substring(1);
             if (rootNode.hasNode(qNodeRelPath)) {
                 Node qNode = rootNode.getNode(qNodeRelPath);
@@ -139,7 +139,7 @@
 
         /* test if resource path does not exist -> thus indicating that
         the query must be made persistent by calling Query.save(String) */
-        if (!getRepositorySession().itemExists(itemPath)) {
+        if (itemPath != null && !getRepositorySession().itemExists(itemPath)) {
             try {
                 q.storeAsNode(itemPath);
             } catch (RepositoryException e) {



Mime
View raw message