Skip to content

Commit

Permalink
scripting: fix crash when an invalid VM is found
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Nov 22, 2024
1 parent 7217aa5 commit ff3f889
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Platform/macOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@
guard let data = data else {
return []
}
return data.virtualMachines.map { vm in
UTMScriptingVirtualMachineImpl(for: vm, data: data)
return data.virtualMachines.compactMap { vm in
if vm.wrapped != nil {
return UTMScriptingVirtualMachineImpl(for: vm, data: data)
} else {
return nil
}
}
}

Expand Down

0 comments on commit ff3f889

Please sign in to comment.