Skip to content

Commit 1b00345

Browse files
committed
Merge pull request #1804 from NativeScript/null-check
null/undefined check added
2 parents 221f49d + ceff5d2 commit 1b00345

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/services/xcproj-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class XcprojService implements IXcprojService {
3939
let cocoapodVer = this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait().cocoapodVer,
4040
xcodeVersion = this.$xcodeSelectService.getXcodeVersion().wait();
4141

42-
if(!semver.valid(cocoapodVer)) {
42+
if(cocoapodVer && !semver.valid(cocoapodVer)) {
4343
// Cocoapods betas have names like 1.0.0.beta.8
4444
// These 1.0.0 betas are not valid semver versions, but they are working fine with XCode 7.3
4545
// So get only the major.minor.patch version and consider them as 1.0.0
@@ -50,7 +50,7 @@ class XcprojService implements IXcprojService {
5050
// CocoaPods with version lower than 1.0.0 don't support Xcode 7.3 yet
5151
// https://github.com/CocoaPods/CocoaPods/issues/2530#issuecomment-210470123
5252
// as a result of this all .pbxprojects touched by CocoaPods get converted to XML plist format
53-
let shouldUseXcproj = !!(semver.lt(cocoapodVer, "1.0.0") && ~helpers.versionCompare(xcodeVersion, "7.3.0")),
53+
let shouldUseXcproj = cocoapodVer && !!(semver.lt(cocoapodVer, "1.0.0") && ~helpers.versionCompare(xcodeVersion, "7.3.0")),
5454
xcprojAvailable: boolean;
5555

5656
if (shouldUseXcproj) {

0 commit comments

Comments
 (0)