From 4519b2b7d4c9112eed7f12bf73af6cac7441cfc2 Mon Sep 17 00:00:00 2001 From: Ben Toews Date: Tue, 1 Aug 2017 12:05:55 -0600 Subject: [PATCH] kill app when we can't connect to driver --- SoftU2FTool/AppDelegate.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SoftU2FTool/AppDelegate.swift b/SoftU2FTool/AppDelegate.swift index 84672f9..6c3a13b 100644 --- a/SoftU2FTool/AppDelegate.swift +++ b/SoftU2FTool/AppDelegate.swift @@ -12,12 +12,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { if !U2FAuthenticator.start() { print("Error starting authenticator") + NSApplication.shared().terminate(self) } } func applicationWillTerminate(_ aNotification: Notification) { - if !U2FAuthenticator.stop() { + if U2FAuthenticator.shared != nil && !U2FAuthenticator.stop() { print("Error stopping authenticator") } }