File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1855,10 +1855,13 @@ pbxProject.prototype.removeTarget = function(target, targetKey) {
18551855
18561856 if ( ! stillReferenced ) {
18571857 var frameworkFileRef = fileReferenceSection [ fileRef ] ;
1858- var fileToRemove = new pbxFile ( unquote ( frameworkFileRef . path ) , { basename : frameworkFileRef . name } ) ;
1859- fileToRemove . fileRef = fileRef ;
1860- this . removeFromFrameworksPbxGroup ( fileToRemove ) ;
1861- removeItemAndCommentFromSectionByUuid ( fileReferenceSection , fileRef ) ;
1858+ if ( frameworkFileRef ?. path ) {
1859+ // when working with widgets, the framework might be in a different group
1860+ var fileToRemove = new pbxFile ( unquote ( frameworkFileRef . path ) , { basename : frameworkFileRef . name } ) ;
1861+ fileToRemove . fileRef = fileRef ;
1862+ this . removeFromFrameworksPbxGroup ( fileToRemove ) ;
1863+ removeItemAndCommentFromSectionByUuid ( fileReferenceSection , fileRef ) ;
1864+ }
18621865 }
18631866 }
18641867 files = files . concat ( frameworkFiles ) ;
You can’t perform that action at this time.
0 commit comments