Prevent NullPointerException if "gatewayServer" does not exist

This commit is contained in:
Kwon, Yeong-Eon 2016-06-14 09:37:27 +09:00
parent 794d4b385f
commit ccbf7efa56

View file

@ -125,8 +125,10 @@ public class PythonInterpreter extends Interpreter {
logger.info("closing Python interpreter .....");
try {
process.close();
gatewayServer.shutdown();
if (process != null)
process.close();
if (gatewayServer != null)
gatewayServer.shutdown();
} catch (IOException e) {
logger.error("Can't close the interpreter", e);
}