Fix fatal crash if enduser_setup.stop() called twice.

This commit is contained in:
Johny Mattsson 2016-03-01 18:33:11 +11:00
parent a3d9d3ea47
commit 969e9f2e90
1 changed files with 3 additions and 2 deletions

View File

@ -332,7 +332,8 @@ static void enduser_setup_check_station_stop(void)
{
ENDUSER_SETUP_DEBUG(lua_getstate(), "enduser_setup_check_station_stop");
os_timer_disarm(&(state->check_station_timer));
if (state != NULL)
os_timer_disarm(&(state->check_station_timer));
}
@ -1197,7 +1198,7 @@ static void enduser_setup_dns_stop(void)
{
ENDUSER_SETUP_DEBUG(lua_getstate(), "enduser_setup_dns_stop");
if (state->espconn_dns_udp != NULL)
if (state != NULL && state->espconn_dns_udp != NULL)
{
espconn_delete(state->espconn_dns_udp);
}