diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 00:46:50 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 00:46:50 +0000 |
commit | b4c1b71fe17086adc766a0db5946eae3f1ee0c10 (patch) | |
tree | c0ffb1a07417b57af3787e46f61e72bfafbef832 /chrome | |
parent | 1dfd4daa5a9cf18d1fefffbd9cd72df138bab9bc (diff) | |
download | chromium_src-b4c1b71fe17086adc766a0db5946eae3f1ee0c10.zip chromium_src-b4c1b71fe17086adc766a0db5946eae3f1ee0c10.tar.gz chromium_src-b4c1b71fe17086adc766a0db5946eae3f1ee0c10.tar.bz2 |
[Mac] Prevent a crash with the DownloadStartedAnimation.
The initializer for the class can sometimes return nil. If so, do not try to
access an ivar directly.
BUG=51307
TEST=none
Review URL: http://codereview.chromium.org/3060047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/download_started_animation_mac.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/download_started_animation_mac.mm b/chrome/browser/cocoa/download_started_animation_mac.mm index f756bb0..dfd7db7 100644 --- a/chrome/browser/cocoa/download_started_animation_mac.mm +++ b/chrome/browser/cocoa/download_started_animation_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -176,6 +176,10 @@ class DownloadAnimationTabObserver : public NotificationObserver { // Will be deleted when the animation is complete in -animationComplete. DownloadStartedAnimationMac* controller = [[self alloc] initWithTabContents:contents]; + // The initializer can return nil. + if (!controller) + return; + // The |animation_| releaes itself when done. [controller->animation_ startAnimation]; } |