From 17f86105ef1ad30166a7c81b613f1147a6c3b629 Mon Sep 17 00:00:00 2001 From: "Samuel E. Giddins" Date: Sat, 25 Jul 2015 21:16:02 -0700 Subject: [PATCH] [NativeTarget] Return nil for #platform_name when #sdk is nil --- lib/xcodeproj/project/object/native_target.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xcodeproj/project/object/native_target.rb b/lib/xcodeproj/project/object/native_target.rb index 7b3129413..6fda837fb 100644 --- a/lib/xcodeproj/project/object/native_target.rb +++ b/lib/xcodeproj/project/object/native_target.rb @@ -89,6 +89,7 @@ def sdk # @return [Symbol] the name of the platform of the target. # def platform_name + return unless sdk if sdk.include? 'iphoneos' :ios elsif sdk.include? 'macosx' @@ -101,9 +102,8 @@ def platform_name # @return [String] the version of the SDK. # def sdk_version - if sdk - sdk.scan(/[0-9.]+/).first - end + return unless sdk + sdk.scan(/[0-9.]+/).first end # @return [String] the deployment target of the target according to its