@@ -456,13 +456,15 @@ pbxProject.prototype.removeFromLibrarySearchPaths = function (file) {
456
456
if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
457
457
continue ;
458
458
459
- if ( buildSettings [ SEARCH_PATHS ] ) {
460
- var matches = buildSettings [ SEARCH_PATHS ] . filter ( function ( p ) {
459
+ searchPaths = buildSettings [ SEARCH_PATHS ] ;
460
+
461
+ if ( searchPaths ) {
462
+ var matches = searchPaths . filter ( function ( p ) {
461
463
return p . indexOf ( new_path ) > - 1 ;
462
464
} ) ;
463
465
matches . forEach ( function ( m ) {
464
- var idx = buildSettings [ SEARCH_PATHS ] . indexOf ( m ) ;
465
- buildSettings [ SEARCH_PATHS ] . splice ( idx , 1 ) ;
466
+ var idx = searchPaths . indexOf ( m ) ;
467
+ searchPaths . splice ( idx , 1 ) ;
466
468
} ) ;
467
469
}
468
470
@@ -480,7 +482,8 @@ pbxProject.prototype.addToLibrarySearchPaths = function (file) {
480
482
if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
481
483
continue ;
482
484
483
- if ( ! buildSettings [ 'LIBRARY_SEARCH_PATHS' ] ) {
485
+ if ( ! buildSettings [ 'LIBRARY_SEARCH_PATHS' ]
486
+ || buildSettings [ 'LIBRARY_SEARCH_PATHS' ] === INHERITED ) {
484
487
buildSettings [ 'LIBRARY_SEARCH_PATHS' ] = [ INHERITED ] ;
485
488
}
486
489
@@ -610,7 +613,8 @@ function correctForResourcesPath(file, project) {
610
613
}
611
614
612
615
function searchPathForFile ( file , proj ) {
613
- var pluginsPath = proj . pbxGroupByName ( 'Plugins' ) . path ,
616
+ var plugins = proj . pbxGroupByName ( 'Plugins' )
617
+ pluginsPath = plugins ? plugins . path : null ,
614
618
fileDir = path . dirname ( file . path ) ;
615
619
616
620
if ( fileDir == '.' ) {
0 commit comments