Fixed #5833: add a check to cc.Scale9Sprite._cacheScale9Sprite

Add a check to cc.Scale9Sprite._cacheScale9Sprite