Possible use of null pointer.

Or maybe better to add CCASSERT.
This commit is contained in:
Anton Sokolchenko 2014-06-09 02:12:17 +03:00
parent 76d9916864
commit 1a16dd02f8
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,7 @@ bool ControlColourPicker::init()
// Add image
_background=ControlUtils::addSpriteToTargetWithPosAndAnchor("menuColourPanelBackground.png", spriteSheet, Vec2::ZERO, Vec2(0.5f, 0.5f));
if(!_background) return false;
CC_SAFE_RETAIN(_background);
Vec2 backgroundPointZero = _background->getPosition() - Vec2(_background->getContentSize().width / 2, _background->getContentSize().height / 2);