BaseTools: Fix build crash when fdf is empty file

Fix build crash when fdf is empty file

Fix https://bugzilla.tianocore.org/show_bug.cgi?id=912

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Yunhua Feng 2018-07-25 12:21:54 +08:00 committed by Yonghong Zhu
parent 1bf23e6b7f
commit 3b46dd93dd
1 changed files with 2 additions and 0 deletions

View File

@ -423,6 +423,8 @@ class FdfParser:
def __StringToList(self):
self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
if not self.Profile.FileLinesList:
EdkLogger.error('FdfParser', FILE_READ_FAILURE, 'The file is empty!', File=self.FileName)
self.Profile.FileLinesList[-1].append(' ')
def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):