From 82067d1424421e881e2eec1b294a1c385a52da1c Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sat, 10 Oct 2015 19:07:00 +0200 Subject: [PATCH] add try catch for the modpe commands to avoid crashes --- src/lib/serverPlugins/modpe.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/serverPlugins/modpe.js b/src/lib/serverPlugins/modpe.js index b0c2be2..e15d66c 100644 --- a/src/lib/serverPlugins/modpe.js +++ b/src/lib/serverPlugins/modpe.js @@ -184,7 +184,12 @@ function inject(serv,settings) player.on('modpe', function (command) { console.log(command); - procCmd(command); + try { + procCmd(command); + } + catch(err) { + console.log("MODPE error: "+err.stack); + } }); function newLevel() {