Index: gnu/xml/dom/ls/SAXEventSink.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/ls/SAXEventSink.java,v retrieving revision 1.8 diff -u -r1.8 SAXEventSink.java --- gnu/xml/dom/ls/SAXEventSink.java 7 Feb 2007 10:08:56 -0000 1.8 +++ gnu/xml/dom/ls/SAXEventSink.java 19 Feb 2007 09:23:52 -0000 @@ -144,37 +144,40 @@ final String PROPERTIES = "http://xml.org/sax/properties/"; final String GNU_PROPERTIES = "http://gnu.org/sax/properties/"; - boolean standalone = reader.getFeature(FEATURES + "is-standalone"); - doc.setXmlStandalone(standalone); - try - { - String version = (String) reader.getProperty(PROPERTIES + - "document-xml-version"); - doc.setXmlVersion(version); - } - catch (SAXNotRecognizedException e) - { - } - catch (SAXNotSupportedException e) + if (reader != null) { + boolean standalone = reader.getFeature(FEATURES + "is-standalone"); + doc.setXmlStandalone(standalone); + try + { + String version = (String) reader.getProperty(PROPERTIES + + "document-xml-version"); + doc.setXmlVersion(version); + } + catch (SAXNotRecognizedException e) + { + } + catch (SAXNotSupportedException e) + { + } + try + { + String encoding = (String) reader.getProperty(GNU_PROPERTIES + + "document-xml-encoding"); + doc.setXmlEncoding(encoding); + } + catch (SAXNotRecognizedException e) + { + } + catch (SAXNotSupportedException e) + { + } } if (locator != null && locator instanceof Locator2) { String encoding = ((Locator2) locator).getEncoding(); doc.setInputEncoding(encoding); } - try - { - String encoding = (String) reader.getProperty(GNU_PROPERTIES + - "document-xml-encoding"); - doc.setXmlEncoding(encoding); - } - catch (SAXNotRecognizedException e) - { - } - catch (SAXNotSupportedException e) - { - } } public void endDocument()