Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function routeToParent(message) {
if(meta_routing_table.parent === 'local') {
// fall to common ipc instance if klyng's is not there (happens in unit tests)
ipc = ipc.klyngLocal || ipc;
if(!monitor_socket.destroyed) {
ipc.server.emit(monitor_socket, 'MONITOR:MSG', message);
}
}
else {
if(!!monitor_socket && !monitor_socket.socket.destroyed) {
monitor_socket.emit('MONITOR:MSG', message);
}
}
}