Fixed crash at project load when features.libraries is empty (i.e. no libraries are provided).
authorEdouard Tisserant
Wed, 04 Jun 2014 09:50:08 +0200
changeset 1413 dd89016a5028
parent 1412 50192dd2f5ff
child 1414 8a3998d10b81
Fixed crash at project load when features.libraries is empty (i.e. no libraries are provided).
ProjectController.py
--- a/ProjectController.py	Fri May 30 02:20:19 2014 +0200
+++ b/ProjectController.py	Wed Jun 04 09:50:08 2014 +0200
@@ -87,15 +87,15 @@
                 """+targets.GetTargetChoices()+"""
                 </xsd:choice>
               </xsd:complexType>
-            </xsd:element>
-            <xsd:element name="Libraries" minOccurs="0">"""+(("""
+            </xsd:element>"""+(("""
+            <xsd:element name="Libraries" minOccurs="0">
               <xsd:complexType>
               """+"\n".join(['<xsd:attribute name='+
                              '"Enable_'+ libname + '_Library" '+
                              'type="xsd:boolean" use="optional" default="true"/>'
                              for libname,lib in features.libraries])+"""
-              </xsd:complexType>""") if len(features.libraries)>0 else '<xsd:complexType/>') + """
-            </xsd:element>
+              </xsd:complexType>
+            </xsd:element>""") if len(features.libraries)>0 else '') + """
           </xsd:sequence>
           <xsd:attribute name="URI_location" type="xsd:string" use="optional" default=""/>
           <xsd:attribute name="Disable_Extensions" type="xsd:boolean" use="optional" default="false"/>