Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB190108E5 for ; Thu, 2 Jan 2014 18:13:27 +0000 (UTC) Received: (qmail 28686 invoked by uid 500); 2 Jan 2014 18:11:20 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 28042 invoked by uid 500); 2 Jan 2014 18:10:25 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 27229 invoked by uid 99); 2 Jan 2014 18:09:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jan 2014 18:09:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9A34A9143FC; Thu, 2 Jan 2014 18:09:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org Date: Thu, 02 Jan 2014 18:09:23 -0000 Message-Id: <0ed445b0fcbc495fb4056ff339ea44bb@git.apache.org> In-Reply-To: <5c931f16fab54588a585ae3f68220bf7@git.apache.org> References: <5c931f16fab54588a585ae3f68220bf7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] git commit: Handle error when splash image is missing. Handle error when splash image is missing. >From pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/1 Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/d799eda0 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/d799eda0 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/d799eda0 Branch: refs/heads/master Commit: d799eda0204f4fee7a8ca8b9ba9c844b69a9d56a Parents: 9541c1e Author: Nathan Peles Authored: Fri Dec 6 14:38:01 2013 -0500 Committer: Andrew Grieve Committed: Fri Dec 6 14:38:28 2013 -0500 ---------------------------------------------------------------------- src/ios/CDVSplashScreen.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/d799eda0/src/ios/CDVSplashScreen.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m index a1c11c3..bba7deb 100644 --- a/src/ios/CDVSplashScreen.m +++ b/src/ios/CDVSplashScreen.m @@ -163,7 +163,7 @@ - (void)updateBounds { UIImage* img = _imageView.image; - CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height); + CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero; CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size; @@ -172,8 +172,8 @@ CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil]; if (!(IsAtLeastiOSVersion(@"7.0"))) { imgBounds.origin.y -= statusFrame.size.height; - } - } else { + } + } else if (imgBounds.size.width > 0) { CGRect viewBounds = self.viewController.view.bounds; CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height; CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;