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)