Josh Soref created CB-7658: ------------------------------ Summary: generateTabletXMLFile shouldn't iterate config.configFileInjections unless it has elements Key: CB-7658 URL: https://issues.apache.org/jira/browse/CB-7658 Project: Apache Cordova Issue Type: Bug Components: BlackBerry Affects Versions: 3.5.0 Reporter: Josh Soref Assignee: Josh Soref
The current code checks to see if there's a non null, array, before iterating over config.configFileInjections, but... {quote} function processResult(data, session) { var widgetConfig = {}; ... //store any config-file element injections widgetConfig.configFileInjections = _config_doc.findall("config-file"); return widgetConfig; {quote} {quote} 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}); } {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)