diff --git a/helpers/learnRFData.js b/helpers/learnRFData.js index e22a2e59..61bfafc3 100644 --- a/helpers/learnRFData.js +++ b/helpers/learnRFData.js @@ -18,6 +18,8 @@ const stop = (log, device) => { if (currentDevice) currentDevice.cancelLearn(); setTimeout(() => { + if (!closeClient) return; + closeClient(); closeClient = null; isClosingClient = false;