fix annoying "callBackName cannot be found" log

This commit is contained in:
dimon4eg 2016-03-14 12:11:23 +02:00
parent 45bbc8a1ae
commit b7779180b1
1 changed files with 3 additions and 1 deletions

View File

@ -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<WidgetCallBackHandlerProtocol *>(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)