From aa95e2f79c2d8a60c30e1aa69c7cd7077779e039 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Tue, 28 Jun 2011 11:50:32 +0000 Subject: ArmPlatformPkg/Bds: Check if the assumed requirements are set before to use it There were some assumptions that some PCDs and protocols were defined. Check if these requirements are defined; either print a debug message to inform the user or skip the statements that require these PCDs or protocol. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11915 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootMenu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ArmPlatformPkg/Bds/BootMenu.c') diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 1bcf2ad00f..35c569d0b7 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -427,7 +427,11 @@ BootMenuMain ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol; Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol); - ASSERT_EFI_ERROR(Status); + if (EFI_ERROR(Status)) { + // You must provide an implementation of DevicePathToTextProtocol in your firmware (eg: DevicePathDxe) + DEBUG((EFI_D_ERROR,"Error: Bds requires DevicePathToTextProtocol\n")); + return Status; + } DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText(BootOption->FilePathList,TRUE,TRUE); Print(L"\t- %s\n",DevicePathTxt); -- cgit v1.2.3