File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,13 +293,14 @@ struct HomeView: View {
293293 startHeartbeatInBackground ( showErrorUI: false )
294294 DispatchQueue . global ( qos: . userInitiated) . async {
295295 sleep ( 1 )
296- var error : NSError ?
297- let success = JITEnableContext . shared. killProcess ( withPID: Int32 ( pid) , error: & error)
298- DispatchQueue . main. async {
299- if success {
296+ do {
297+ try JITEnableContext . shared. killProcess ( withPID: Int32 ( pid) )
298+ DispatchQueue . main. async {
300299 LogManager . shared. addInfoLog ( " Killed process \( pid) via URL scheme " )
301- } else {
302- LogManager . shared. addErrorLog ( " Failed to kill process \( pid) : \( error? . localizedDescription ?? " Unknown error " ) " )
300+ }
301+ } catch {
302+ DispatchQueue . main. async {
303+ LogManager . shared. addErrorLog ( " Failed to kill process \( pid) : \( error. localizedDescription) " )
303304 }
304305 }
305306 }
You can’t perform that action at this time.
0 commit comments