diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs index 9730b01bed..d4e09fd1c3 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs @@ -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) {