Commit aa4f4cad9a245fd1c90aaa22820e71b1536bad17

Authored by Olli-Pekka Kahilakoski
1 parent 490d87a8
Exists in master

FIX: StopNavigation function when serial port connection has not been formed

StopNavigation function is called, e.g., when InVesalius is quitted. If the
serial port was enabled in the UI but navigation had not been started, it
previously caused an error because serial_port_connection variable was None.
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
invesalius/navigation/navigation.py
... ... @@ -324,9 +324,10 @@ class Navigation():
324 324 self.coord_queue.clear()
325 325 self.coord_queue.join()
326 326  
327   - if self.SerialPortEnabled():
  327 + if self.serial_port_connection is not None:
328 328 self.serial_port_connection.join()
329 329  
  330 + if self.SerialPortEnabled():
330 331 self.serial_port_queue.clear()
331 332 self.serial_port_queue.join()
332 333  
... ...