Repository: cordova-node-xcode Updated Branches: refs/heads/master be8498daf -> ed7b53995
Fix possible null-access error in "removeFromFrameworksPbxGroup" The method `project.removeFromFrameworksPbxGroup` directly tries to access `children` on `project.pbxGroupByName` - but this method might return `null` if no such group exists. To prevent a runtime error when trying to access a property on `null` we can add a check whether the requested group "Frameworks" does exist in the project and only then continue with the removal of the file. This closes #1 Project: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/commit/ed7b5399 Tree: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/tree/ed7b5399 Diff: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/diff/ed7b5399 Branch: refs/heads/master Commit: ed7b53995d52e61579e8d9fc96ed0a02f4c84dba Parents: be8498d Author: ZauberNerd <[email protected]> Authored: Thu May 4 15:24:06 2017 +0200 Committer: Steve Gill <[email protected]> Committed: Wed Oct 4 14:52:04 2017 -0700 ---------------------------------------------------------------------- lib/pbxProject.js | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/blob/ed7b5399/lib/pbxProject.js ---------------------------------------------------------------------- diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 8047d00..e2e88aa 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -644,6 +644,9 @@ pbxProject.prototype.addToFrameworksPbxGroup = function(file) { } pbxProject.prototype.removeFromFrameworksPbxGroup = function(file) { + if (!this.pbxGroupByName('Frameworks')) { + return null; + } var pluginsGroupChildren = this.pbxGroupByName('Frameworks').children; for (i in pluginsGroupChildren) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
