summaryrefslogtreecommitdiff
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-11 03:24:35 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-11 03:24:35 +0000
commit9184d5da2ff27a48f649ad4763021d06e335d1c5 (patch)
tree3605899788c71ef94dc81e46a8d61617060b64f9 /EmulatorPkg
parentbed0bbc31025aa463d4c5b86f0a02fb4e42a3cc4 (diff)
downloadedk2-platforms-9184d5da2ff27a48f649ad4763021d06e335d1c5.tar.xz
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
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/Library/DxeEmuStdErrSerialPortLib/DxeEmuStdErrSerialPortLib.c4
1 files changed, 4 insertions, 0 deletions
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);
}