diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c index f4fd4c762c..bbfcf98bda 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c @@ -189,11 +189,13 @@ OnRealTimeClockArchNotification ( SystemTable->BootServices->CloseEvent (Event); - Status = SystemTable->RuntimeServices->GetTime ((EFI_TIME *)&mLoggerInfo->Time, NULL); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "%a: error getting real time. Code=%r\n", __FUNCTION__, Status)); - } else { - mLoggerInfo->TicksAtTime = GetPerformanceCounter (); + if (mLoggerInfo != NULL) { + Status = SystemTable->RuntimeServices->GetTime ((EFI_TIME *)&mLoggerInfo->Time, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: error getting real time. Code=%r\n", __func__, Status)); + } else { + mLoggerInfo->TicksAtTime = GetPerformanceCounter (); + } } return;