From 5d98afb73fb136db1b0a9316485208df5682aac2 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Sun, 9 Jul 2023 18:51:15 -0700 Subject: [PATCH] vm: fix error when trying to rename VM Fixes #5444 --- Services/UTMVirtualMachine.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Services/UTMVirtualMachine.swift b/Services/UTMVirtualMachine.swift index 405e82c6d..37ecc7a2b 100644 --- a/Services/UTMVirtualMachine.swift +++ b/Services/UTMVirtualMachine.swift @@ -350,6 +350,7 @@ extension UTMVirtualMachine { let existingPath = pathUrl let newPath = Self.virtualMachinePath(for: config.information.name, in: existingPath.deletingLastPathComponent()) try await config.save(to: existingPath) + try await updateRegistryFromConfig() let hasRenamed: Bool if !isShortcut && existingPath.path != newPath.path { try await Task.detached { @@ -359,10 +360,10 @@ extension UTMVirtualMachine { } else { hasRenamed = false } - try await updateRegistryFromConfig() // reload the config if we renamed in order to point all the URLs to the right path if hasRenamed { try reload(from: newPath) + try await updateRegistryBasics() // update bookmark } } }