[ReactNative] Fix reloading in debug mode sometimes crashes packager

This commit is contained in:
Alex Kotliarskyi 2015-04-24 14:57:24 -07:00
parent a2dd7fc69f
commit a1a15bda06
1 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,12 @@ function attachToServer(server, path) {
ws.on('message', function(message) {
allClientsExcept(ws).forEach(function(cn) {
cn.send(message);
try {
// Sometimes this call throws 'not opened'
cn.send(message);
} catch(e) {
console.warn('WARN: ' + e.message);
}
});
});
});