ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r798016 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java
Date Mon, 27 Jul 2009 03:55:34 GMT
Author: dims
Date: Mon Jul 27 03:55:33 2009
New Revision: 798016

URL: http://svn.apache.org/viewvc?rev=798016&view=rev
Log:
fix NPE

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java?rev=798016&r1=798015&r2=798016&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/StAXDialectDetector.java
Mon Jul 27 03:55:33 2009
@@ -167,12 +167,13 @@
         }
         // For the moment, the dialect detection is quite simple, but in the future we will
probably
         // have to differentiate by version number
-        if (vendor.toLowerCase().indexOf("woodstox") != -1) {
-            return WoodstoxDialect.INSTANCE;
-        } else if (title.indexOf("SJSXP") != -1) {
-            return SJSXPDialect.INSTANCE;
-        } else {
-            return UnknownStAXDialect.INSTANCE;
+        if(vendor != null) {
+            if (vendor.toLowerCase().indexOf("woodstox") != -1) {
+                return WoodstoxDialect.INSTANCE;
+            } else if (title.indexOf("SJSXP") != -1) {
+                return SJSXPDialect.INSTANCE;
+            } 
         }
+        return UnknownStAXDialect.INSTANCE;
     }
 }



Mime
View raw message