From b0f16ddceb365794444e071614d320bb01334a77 Mon Sep 17 00:00:00 2001 From: Pietro Grandi Date: Fri, 23 Mar 2018 11:06:24 +0100 Subject: [PATCH] Fix 'searchPaths.filter is not a function' error #133 --- lib/pbxProject.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 };