zgkxzx/Modbus4Android

If ModbusReq wasn't initialised it will crash when ModbusReq.getInstance().destory()

Opened this issue · 0 comments

When we call ModbusReq.getInstance().destory() it will crash because ModbusReq wasn't initialised.
There is no way to check it was initialised or not. In destroy method this.mModbusMaster.destroy() this string will lead to null pointer exception because this.mModbusMaster is null. Can you add check before. Something like this if(this.isInit == true) than destroy it.
Thanks in advance.