summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}