@@ -456,13 +456,15 @@ pbxProject.prototype.removeFromLibrarySearchPaths = function (file) {
456456 if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
457457 continue ;
458458
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 ) {
461463 return p . indexOf ( new_path ) > - 1 ;
462464 } ) ;
463465 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 ) ;
466468 } ) ;
467469 }
468470
@@ -480,7 +482,8 @@ pbxProject.prototype.addToLibrarySearchPaths = function (file) {
480482 if ( unquote ( buildSettings [ 'PRODUCT_NAME' ] ) != this . productName )
481483 continue ;
482484
483- if ( ! buildSettings [ 'LIBRARY_SEARCH_PATHS' ] ) {
485+ if ( ! buildSettings [ 'LIBRARY_SEARCH_PATHS' ]
486+ || buildSettings [ 'LIBRARY_SEARCH_PATHS' ] === INHERITED ) {
484487 buildSettings [ 'LIBRARY_SEARCH_PATHS' ] = [ INHERITED ] ;
485488 }
486489
@@ -610,7 +613,8 @@ function correctForResourcesPath(file, project) {
610613}
611614
612615function searchPathForFile ( file , proj ) {
613- var pluginsPath = proj . pbxGroupByName ( 'Plugins' ) . path ,
616+ var plugins = proj . pbxGroupByName ( 'Plugins' )
617+ pluginsPath = plugins ? plugins . path : null ,
614618 fileDir = path . dirname ( file . path ) ;
615619
616620 if ( fileDir == '.' ) {
0 commit comments