Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.udpPort.on("data", function (data, info) {
// Prepare an error for when the try catch fails, inside the try this variable will get overridden
var receivedData = {
address : "error",
args : ["The header of an OSC packet didn't contain an OSC address or a #bundle string"]
};
try {
receivedData = osc.readMessage(data);
} catch(e) {
if(self.debug) {
console.log(e);
}
}
self.emit("data", receivedData, info, data);
});