Browse Source

Fixed null reference when validating an .xsd file with no root xs:schema element.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5078 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
8051328c2f
  1. 4
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

4
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

@ -591,7 +591,9 @@ namespace ICSharpCode.XmlEditor @@ -591,7 +591,9 @@ namespace ICSharpCode.XmlEditor
try {
XmlSchema schema = XmlSchema.Read(xmlReader, new ValidationEventHandler(SchemaValidation));
schema.Compile(new ValidationEventHandler(SchemaValidation));
if (schema != null) {
schema.Compile(new ValidationEventHandler(SchemaValidation));
}
} catch (XmlSchemaException ex) {
DisplayValidationError(File.FileName, ex.Message, ex.LinePosition - 1, ex.LineNumber - 1);
} catch (XmlException ex) {

Loading…
Cancel
Save