Author: ssmiweve
Date: 2008-04-18 16:42:38 +0200 (Fri, 18 Apr 2008)
New Revision: 6492

Modified:
   branches/2.16/war/src/main/java/no/sesat/search/http/filters/UserFilter.java
Log:
SEARCH-4646 - sesam.se:9002 does not work with curl/wget


Modified: 
branches/2.16/war/src/main/java/no/sesat/search/http/filters/UserFilter.java
===================================================================
--- 
branches/2.16/war/src/main/java/no/sesat/search/http/filters/UserFilter.java    
    2008-04-18 13:01:15 UTC (rev 6491)
+++ 
branches/2.16/war/src/main/java/no/sesat/search/http/filters/UserFilter.java    
    2008-04-18 14:42:38 UTC (rev 6492)
@@ -280,20 +280,23 @@
 
         LOG.debug("Url: " + url);
         LOG.debug("JndiName: " + jndi);
+        
+        if( null != url && null != jndi ){
 
-        final Properties properties = new Properties();
-        properties.put("java.naming.factory.initial", 
"org.jnp.interfaces.NamingContextFactory");
-        properties.put("java.naming.factory.url.pkgs", 
"org.jboss.naming:org.jnp.interfaces");
-        properties.put("java.naming.provider.url", url);
+            final Properties properties = new Properties();
+            properties.put("java.naming.factory.initial", 
"org.jnp.interfaces.NamingContextFactory");
+            properties.put("java.naming.factory.url.pkgs", 
"org.jboss.naming:org.jnp.interfaces");
+            properties.put("java.naming.provider.url", url);
 
-        try {
-            return (BasicUserService) new 
InitialContext(properties).lookup(jndi);
+            try {
+                return (BasicUserService) new 
InitialContext(properties).lookup(jndi);
 
-        } catch (final NamingException ne) {
-            // acceptable for sesat not to have to have a user service backend
-            LOG.debug(ne.getMessage(), ne);
-            return null;
+            } catch (final NamingException ne) {
+                // acceptable for sesat not to have to have a user service 
backend
+                LOG.debug(ne.getMessage(), ne);
+            }
         }
+        return null;
     }
 
 }

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to