File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Text ;
3
3
using System . Xml ;
4
+ using System . Xml . Schema ;
4
5
5
6
namespace Schneegans . Unattend ;
6
7
@@ -207,7 +208,15 @@ void AddWifiProfile(IProfileWifiSettings settings)
207
208
string logfile = @"%TEMP%\wifi.log" ;
208
209
209
210
XmlDocument profile = settings . ProfileXml ;
210
- Util . ValidateAgainstSchema ( profile , "WLAN_profile_v1.xsd" ) ;
211
+ try
212
+ {
213
+ Util . ValidateAgainstSchema ( profile , "WLAN_profile_v1.xsd" ) ;
214
+ }
215
+ catch ( Exception e ) when ( e is XmlException or XmlSchemaException )
216
+ {
217
+ throw new ConfigurationException ( $ "WLAN profile XML is invalid: { e . Message } ") ;
218
+ }
219
+
211
220
AddXmlFile ( profile , xmlfile ) ;
212
221
213
222
CommandAppender appender = GetAppender ( CommandConfig . Specialize ) ;
You can’t perform that action at this time.
0 commit comments