You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2010/07/18 17:31:35 UTC
svn commit: r965246 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java
Author: mrglavas
Date: Sun Jul 18 15:31:34 2010
New Revision: 965246
URL: http://svn.apache.org/viewvc?rev=965246&view=rev
Log:
Fixing an NPE. The application may have set the ContentHandler / DocumentHandler to null within setDocumentLocator() so we need to check for null again before calling startDocument().
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java?rev=965246&r1=965245&r2=965246&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/AbstractSAXParser.java Sun Jul 18 15:31:34 2010
@@ -262,7 +262,11 @@ public abstract class AbstractSAXParser
if (locator != null) {
fDocumentHandler.setDocumentLocator(new LocatorProxy(locator));
}
- fDocumentHandler.startDocument();
+ // The application may have set the DocumentHandler to null
+ // within setDocumentLocator() so we need to check again.
+ if (fDocumentHandler != null) {
+ fDocumentHandler.startDocument();
+ }
}
// SAX2
@@ -270,7 +274,11 @@ public abstract class AbstractSAXParser
if (locator != null) {
fContentHandler.setDocumentLocator(new LocatorProxy(locator));
}
- fContentHandler.startDocument();
+ // The application may have set the ContentHandler to null
+ // within setDocumentLocator() so we need to check again.
+ if (fContentHandler != null) {
+ fContentHandler.startDocument();
+ }
}
}
catch (SAXException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org