Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7658

generateTabletXMLFile shouldn't iterate config.configFileInjections unless it has elements

    XMLWordPrintableJSON

Details

    Description

      The current code checks to see if there's a non null, array, before iterating over config.configFileInjections, but...

      function processResult(data, session) {
      var widgetConfig = {};
      ...
      //store any config-file element injections
      widgetConfig.configFileInjections = _config_doc.findall("config-file");

      return widgetConfig;

      function generateTabletXMLFile(session, config) {
      ...
      //Inject any config-file modifications for bar-descriptor.xml
      if (config.configFileInjections && Array.isArray(config.configFileInjections)) {
      xmlDoc = new et.ElementTree(et.XML(xmlData));
      config.configFileInjections.forEach(function (config_file) {
      if (config_file.attrib["parent"] && config_file.attrib["target"] && config_file.attrib["target"] === "bar-descriptor.xml") {
      xmlHelper.graftXML(xmlDoc, config_file._children, config_file.attrib["parent"]);
      }
      });
      xmlData = xmlDoc.write({indent: 4});
      }

      Attachments

        Activity

          People

            jsoref Josh Soref
            jsoref Josh Soref
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: