Merge pull request #4298 from boyu0/fix_keypadtest_crash

[ci skip]fix keypad test crash bug
This commit is contained in:
minggo 2013-11-17 23:01:10 -08:00
commit bbb579faad
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;
}