From e5127d8e8ed7de4ff3f2521d273116cc1d344183 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 3 Jul 2020 17:17:57 +0200 Subject: [PATCH] Fix possible watchdog/exception Fix possible watchdog/exception (#8828) --- tasmota/support_rotary.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index cd80b4484..cfe549a5f 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -213,6 +213,8 @@ void update_rotary(void) { } bool RotaryButtonPressed(void) { + if (!Rotary.present) { return false; } + bool powered_on = (power); #ifdef USE_LIGHT if (!Settings.flag4.rotary_uses_rules) { // SetOption98 - Use rules instead of light control @@ -246,6 +248,8 @@ void RotaryInit(void) { \*********************************************************************************************/ void RotaryHandler(void) { + if (!Rotary.present) { return; } + if (Rotary.timeout) { Rotary.timeout--; if (!Rotary.timeout) {