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 11using  System ; 
22using  System . Text ; 
33using  System . Xml ; 
4+ using  System . Xml . Schema ; 
45
56namespace  Schneegans . Unattend ; 
67
@@ -207,7 +208,15 @@ void AddWifiProfile(IProfileWifiSettings settings)
207208    string  logfile  =  @"%TEMP%\wifi.log" ; 
208209
209210    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+ 
211220    AddXmlFile ( profile ,  xmlfile ) ; 
212221
213222    CommandAppender  appender  =  GetAppender ( CommandConfig . Specialize ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments