[commissioner] fix duplicate commissioner start (#4899)

This commit fixes the bug that duplicate commissioner start will
incorrectly close CoapSecure.
This commit is contained in:
Simon Lin
2020-04-29 10:51:43 -07:00
committed by GitHub
parent e5069a41d5
commit dd3b14dad0
+4 -1
View File
@@ -173,7 +173,10 @@ exit:
if (error != OT_ERROR_NONE)
{
otLogWarnMeshCoP("Failed to start commissioner: %s", otThreadErrorToString(error));
Get<Coap::CoapSecure>().Stop();
if (error != OT_ERROR_ALREADY)
{
Get<Coap::CoapSecure>().Stop();
}
}
return error;