fix assertions

'label' could be not caught after previous assertions
This commit is contained in:
Anton Sokolchenko 2014-06-09 02:04:44 +03:00
parent 76d9916864
commit f5efc49903
1 changed files with 2 additions and 2 deletions

View File

@ -71,10 +71,10 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b
{
if (Control::init())
{
CCASSERT(node != nullptr, "Label must not be nil.");
CCASSERT(node != nullptr, "node must not be nil.");
LabelProtocol* label = dynamic_cast<LabelProtocol*>(node);
CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil.");
CCASSERT(label != nullptr || backgroundSprite != nullptr, "");
CCASSERT(label != nullptr, "label must not be nil.);
_parentInited = true;