mirror of https://github.com/axmolengine/axmol.git
fix for undefined protocol
This commit is contained in:
parent
f0ab05f9e7
commit
c9077961e8
|
@ -291,7 +291,7 @@ bool WebSocket::init(const Delegate& delegate,
|
|||
_wsProtocols = new libwebsocket_protocols[protocolCount+1];
|
||||
memset(_wsProtocols, 0, sizeof(libwebsocket_protocols)*(protocolCount+1));
|
||||
|
||||
if (protocols)
|
||||
if (protocols && protocols->size() > 0)
|
||||
{
|
||||
int i = 0;
|
||||
for (std::vector<std::string>::const_iterator iter = protocols->begin(); iter != protocols->end(); ++iter, ++i)
|
||||
|
|
|
@ -246,7 +246,7 @@ JSBool js_cocos2dx_extension_WebSocket_constructor(JSContext *cx, uint32_t argc,
|
|||
JSB_WebSocketDelegate* delegate = new JSB_WebSocketDelegate();
|
||||
delegate->setJSDelegate(obj);
|
||||
|
||||
if (argc == 2 && !JSVAL_IS_VOID(argv[1]))
|
||||
if (argc == 2)
|
||||
{
|
||||
std::vector<std::string> protocols;
|
||||
|
||||
|
|
Loading…
Reference in New Issue