Pārlūkot izejas kodu

config(apple): create generic platform if it does not exist

osy 9 mēneši atpakaļ
vecāks
revīzija
662dfb9cf0
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      Configuration/UTMAppleConfigurationSystem.swift

+ 4 - 0
Configuration/UTMAppleConfigurationSystem.swift

@@ -67,6 +67,10 @@ struct UTMAppleConfigurationSystem: Codable {
         boot = try values.decode(UTMAppleConfigurationBoot.self, forKey: .boot)
         macPlatform = try values.decodeIfPresent(UTMAppleConfigurationMacPlatform.self, forKey: .macPlatform)
         genericPlatform = try values.decodeIfPresent(UTMAppleConfigurationGenericPlatform.self, forKey: .genericPlatform)
+        if boot.operatingSystem == .linux && genericPlatform == nil {
+            // fix a bug where this was not created
+            genericPlatform = UTMAppleConfigurationGenericPlatform()
+        }
     }
     
     func encode(to encoder: Encoder) throws {