Author: jens
Date: Tue Jul 31 20:30:25 2012
New Revision: 1367759

URL: http://svn.apache.org/viewvc?rev=1367759&view=rev
Log:
InMemrory: avoid NPE in query if types do not match

Modified:
    
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java?rev=1367759&r1=1367758&r2=1367759&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
 Tue Jul 31 20:30:25 2012
@@ -473,11 +473,15 @@ public class InMemoryQueryProcessor {
 
             String propVal = (String) PropertyUtil.getProperty(so, 
colRef.getPropertyId(), pd);
             
-            String pattern = translatePattern((String) rVal); // SQL to Java
-                                                              // regex
-                                                              // syntax
-            Pattern p = Pattern.compile(pattern);
-            return p.matcher(propVal).matches();
+            if (null == propVal) {
+               return false;
+            } else {
+               String pattern = translatePattern((String) rVal); // SQL to Java
+               // regex
+               // syntax
+               Pattern p = Pattern.compile(pattern);
+               return p.matcher(propVal).matches();
+            }
         }
 
         @Override


Reply via email to