From 61816ccdfefcfb08d954c20a1024b313c96ced8e Mon Sep 17 00:00:00 2001 From: Markus Quaritsch <markus.quaritsch@tugraz.at> Date: Thu, 27 Jun 2019 17:38:36 +0200 Subject: [PATCH] xmlvalidator: in case the file to validate is not of a known schema, call the validation callback with null as arguments. --- VectoCore/VectoCore/Utils/XMLValidator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VectoCore/VectoCore/Utils/XMLValidator.cs b/VectoCore/VectoCore/Utils/XMLValidator.cs index eb5d5e61fc..76dcdfde63 100644 --- a/VectoCore/VectoCore/Utils/XMLValidator.cs +++ b/VectoCore/VectoCore/Utils/XMLValidator.cs @@ -84,6 +84,7 @@ namespace TUGraz.VectoCore.Utils if (_doc.SchemaInfo.Validity != XmlSchemaValidity.Valid || _doc.DocumentElement?.SchemaInfo == null || _doc.DocumentElement.SchemaInfo.SchemaType == null) { + ValidationCallBack(null, null); _valid = false; } @@ -94,7 +95,7 @@ namespace TUGraz.VectoCore.Utils { _resultAction(false); _valid = false; - _validationErrorAction(args.Severity, new ValidationEvent { ValidationEventArgs = args }); + _validationErrorAction(args?.Severity ?? XmlSeverityType.Error, new ValidationEvent { ValidationEventArgs = args }); } public static void CallBackExceptionOnError(XmlSeverityType severity, ValidationEvent evt) -- GitLab