From 8f31f82568e9bced7f3307063785549651ea8906 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Thu, 15 Feb 2024 17:36:21 +0300 Subject: Fix error with an empty string token Signed-off-by: Konstantin Aladyshev --- Lessons_uncategorized/Lesson_Varstore_6/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lessons_uncategorized/Lesson_Varstore_6/README.md') diff --git a/Lessons_uncategorized/Lesson_Varstore_6/README.md b/Lessons_uncategorized/Lesson_Varstore_6/README.md index a5f9236..b6af888 100644 --- a/Lessons_uncategorized/Lesson_Varstore_6/README.md +++ b/Lessons_uncategorized/Lesson_Varstore_6/README.md @@ -145,7 +145,10 @@ VOID CallbackValueToStr(UINT8 Type, EFI_IFR_TYPE_VALUE *Value, EFI_STRING* Value UnicodeSPrint(*ValueStr, ValueStrSize, L"%04d/%02d/%02d", Value->date.Year, Value->date.Month, Value->date.Day); break; case EFI_IFR_TYPE_STRING: - UnicodeSPrint(*ValueStr, ValueStrSize, L"%s", HiiGetString(mHiiHandle, Value->string, "en-US")); + if (Value->string) + UnicodeSPrint(*ValueStr, ValueStrSize, L"%s", HiiGetString(mHiiHandle, Value->string, "en-US")); + else + UnicodeSPrint(*ValueStr, ValueStrSize, L"NO STRING!"); break; default: UnicodeSPrint(*ValueStr, ValueStrSize, L"Unknown"); -- cgit v1.2.3-18-g5258