Skip to content

Commit

Permalink
Minor change in cmd::ClearRect to avoid static analysis confusion (close
Browse files Browse the repository at this point in the history
 #1478)

The Cel argument in ClearRect() ctor must not be nullptr.
  • Loading branch information
dacap committed Jun 5, 2018
1 parent 65e28c8 commit f29ead0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/cmd/clear_rect.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
Expand All @@ -23,9 +23,9 @@ using namespace doc;

ClearRect::ClearRect(Cel* cel, const gfx::Rect& bounds)
{
app::Document* doc = static_cast<app::Document*>(cel->document());
ASSERT(cel);

Image* image = (cel ? cel->image(): NULL);
Image* image = cel->image();
if (!image)
return;

Expand All @@ -41,6 +41,8 @@ ClearRect::ClearRect(Cel* cel, const gfx::Rect& bounds)
return;

m_dstImage.reset(new WithImage(image));

app::Document* doc = static_cast<app::Document*>(cel->document());
m_bgcolor = doc->bgColor(cel->layer());

m_copy.reset(crop_image(image,
Expand Down

0 comments on commit f29ead0

Please sign in to comment.