From 4150d12fdbac38d546aad522b11e60125a354b8c Mon Sep 17 00:00:00 2001 From: Pierre-Dominique CHARRON Date: Tue, 5 Sep 2023 18:10:27 +0200 Subject: [PATCH] fix adding a build phase when some file references doesn't have a path (e.g. Assets.xcassets) --- lib/pbxProject.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 1133940f..ec661665 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -916,7 +916,7 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co buildFile = buildFileSection[buildFileKey]; fileReference = fileReferenceSection[buildFile.fileRef]; - if (!fileReference) continue; + if (!fileReference || !fileReference.path) continue; var pbxFileObj = new pbxFile(fileReference.path); @@ -1148,7 +1148,7 @@ pbxProject.prototype.updateBuildProperty = function(prop, value, build, targetNa } } } - + var configs = this.pbxXCBuildConfigurationSection(); for (var configName in configs) { if (!COMMENT_KEY.test(configName)) { @@ -2091,7 +2091,7 @@ pbxProject.prototype.getBuildProperty = function(prop, build, targetName) { } } } - + var configs = this.pbxXCBuildConfigurationSection(); for (var configName in configs) { if (!COMMENT_KEY.test(configName)) {