]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: Fix the bug when no FD section in the FDF file
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index e9f4888aa19946c5f13beb0b0425e4266bd45a09..dfb5b72b13f4270b2802cf1ed3d5a0751bd9d677 100644 (file)
@@ -317,11 +317,12 @@ class WorkspaceAutoGen(AutoGen):
             GlobalData.gFdfParser = Fdf\r
             GlobalData.gAutoGenPhase = False\r
             PcdSet = Fdf.Profile.PcdDict\r
-            FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]\r
-            for FdRegion in FdDict.RegionList:\r
-                if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):\r
-                    if int(FdRegion.Offset) % 8 != 0:\r
-                        EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))\r
+            if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict:\r
+                FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName]\r
+                for FdRegion in FdDict.RegionList:\r
+                    if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList):\r
+                        if int(FdRegion.Offset) % 8 != 0:\r
+                            EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))\r
             ModuleList = Fdf.Profile.InfList\r
             self.FdfProfile = Fdf.Profile\r
             for fvname in self.FvTargetList:\r