From 3b6dd64f8cd71458938bbb6e0e223b589dc96b49 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 7 Dec 2020 11:39:16 +0100
Subject: [PATCH] Allow stop() even if start() hasnt been called yet, for more
 graceful degradation.

---
 RCUSCC/RCUSCC/opcua_connection.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/RCUSCC/RCUSCC/opcua_connection.py b/RCUSCC/RCUSCC/opcua_connection.py
index 282aa24b8..cfcfb74ab 100644
--- a/RCUSCC/RCUSCC/opcua_connection.py
+++ b/RCUSCC/RCUSCC/opcua_connection.py
@@ -74,6 +74,10 @@ class OPCUAConnection(Thread):
           Stop connecting & disconnect. Can take a few seconds for the timeouts to hit.
         """
 
+        if not self.ident:
+            # have not yet been started, so nothing to do
+            return
+
         self.stopping = True
         self.join()
 
-- 
GitLab