From b7779180b12aa40bdf0b9511b3c0caffc98c880b Mon Sep 17 00:00:00 2001 From: dimon4eg Date: Mon, 14 Mar 2016 12:11:23 +0200 Subject: [PATCH] fix annoying "callBackName cannot be found" log --- cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 00feb06da9..3d1bb22ced 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -1135,6 +1135,9 @@ bool CSLoader::bindCallback(const std::string &callbackName, cocos2d::ui::Widget *sender, cocos2d::Node *handler) { + if (callbackName.empty()) + return false; + auto callbackHandler = dynamic_cast(handler); if (callbackHandler) //The handler can handle callback { @@ -1170,7 +1173,6 @@ bool CSLoader::bindCallback(const std::string &callbackName, CCLOG("callBackName %s cannot be found", callbackName.c_str()); return false; - } bool CSLoader::isWidget(const std::string &type)