diff --git a/doorlockd/main.cpp b/doorlockd/main.cpp index ad79d5a..c23cb9d 100644 --- a/doorlockd/main.cpp +++ b/doorlockd/main.cpp @@ -178,8 +178,10 @@ int main(int argc, char** argv) retval = 0; out: - l(LogLevel::info, "Stopping Doorlock Logic"); - logic.reset(); + if (logic) { + l(LogLevel::info, "Stopping Doorlock Logic"); + logic.reset(); + } l(LogLevel::notice, "Doorlockd stopped"); return retval; }