fix keypad test crash bug

This commit is contained in:
boyu0 2013-11-18 14:33:24 +08:00
parent bac14ab3e5
commit eea09d60f7
1 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,11 @@ NS_CC_BEGIN
bool EventListenerKeyboard::checkAvailable()
{
CCASSERT(onKeyPressed && onKeyReleased, "");
if (onKeyPressed == nullptr && onKeyReleased == nullptr)
{
CCASSERT(false, "Invalid EventListenerKeyboard!");
return false;
}
return true;
}