From: andrewfish Date: Thu, 11 Aug 2011 03:24:35 +0000 (+0000) Subject: EmulatorPkg: Make the library work with DXE Core. X-Git-Tag: edk2-stable201903~14414 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9184d5da2ff27a48f649ad4763021d06e335d1c5 EmulatorPkg: Make the library work with DXE Core. The DXE core calls library constructors after it calls DEBUG macros, so we need more error handling in the lib. signed-off-by: andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12118 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c b/EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c index 8d95921c03..00d9f19369 100644 --- a/EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c +++ b/EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c @@ -66,6 +66,10 @@ SerialPortWrite ( IN UINTN NumberOfBytes ) { + if (gEmuThunk == NULL) { + return NumberOfBytes; + } + return gEmuThunk->WriteStdErr (Buffer, NumberOfBytes); }