diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 18033bb..24eabae 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1111,6 +1111,9 @@ pbxProject.prototype.removeFromFrameworkSearchPaths = function(file) { searchPaths = buildSettings[SEARCH_PATHS]; if (searchPaths) { + if (typeof searchPaths === "string") { + searchPaths = [searchPaths]; + } var matches = searchPaths.filter(function(p) { return p.indexOf(new_path) > -1; }); @@ -1158,6 +1161,9 @@ pbxProject.prototype.removeFromLibrarySearchPaths = function(file) { searchPaths = buildSettings[SEARCH_PATHS]; if (searchPaths) { + if (typeof searchPaths === "string") { + searchPaths = [searchPaths]; + } var matches = searchPaths.filter(function(p) { return p.indexOf(new_path) > -1; }); @@ -1810,7 +1816,11 @@ pbxProject.prototype.getPBXGroupByKey = function(key) { }; pbxProject.prototype.getPBXVariantGroupByKey = function(key) { - return this.hash.project.objects['PBXVariantGroup'][key]; + var pbxVariantGroup = this.hash.project.objects['PBXVariantGroup'] + if (key && pbxVariantGroup) { + return pbxVariantGroup[key]; + } + return undefined };