From ed5ed0999a59a5b2639fcf3c9f77e7e21c944a77 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Thu, 14 May 2015 22:12:32 +0200 Subject: [PATCH] Fixed small bug --- doorlockd/logic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doorlockd/logic.cpp b/doorlockd/logic.cpp index d710b41..2463516 100644 --- a/doorlockd/logic.cpp +++ b/doorlockd/logic.cpp @@ -150,13 +150,14 @@ Logic::Response Logic::_lock() Logic::Response Logic::_unlock() { _door.unlock(); - _state = UNLOCKED; _createNewToken(false); if (_state == UNLOCKED) { _logger(LogLevel::warning, "Unable to unlock: already unlocked"); return AlreadyUnlocked; + } else { + _state = UNLOCKED; } return Success;