From f5efc499033419461dee37217e3c333b003d8e5a Mon Sep 17 00:00:00 2001 From: Anton Sokolchenko Date: Mon, 9 Jun 2014 02:04:44 +0300 Subject: [PATCH 1/2] fix assertions 'label' could be not caught after previous assertions --- extensions/GUI/CCControlExtension/CCControlButton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index ff618a8ac2..05a108bd36 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -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(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; From 3edef12094908f8c677c0bb6e28cb46c3e8234e6 Mon Sep 17 00:00:00 2001 From: Anton Sokolchenko Date: Mon, 9 Jun 2014 02:07:43 +0300 Subject: [PATCH 2/2] Update CCControlButton.cpp --- extensions/GUI/CCControlExtension/CCControlButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 05a108bd36..3a01b499bf 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -74,7 +74,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b CCASSERT(node != nullptr, "node must not be nil."); LabelProtocol* label = dynamic_cast(node); CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil."); - CCASSERT(label != nullptr, "label must not be nil.); + CCASSERT(label != nullptr, "label must not be nil."); _parentInited = true;