X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel1CommandsLib%2FGoto.c;h=3e5a59c5756019d325cbca3d4c8f3a27f00960b3;hp=8213fae7ac27b23803d15f8463ce195716277d08;hb=33c031ee2092282a069ce07d30202082ceaf61fe;hpb=a405b86d274d32b92f69842bfb9a1ab143128f57 diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c index 8213fae7ac..3e5a59c575 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c @@ -79,7 +79,17 @@ ShellCommandRunGoto ( // Check forwards and then backwards for a label... // if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_NO_MATCHING), gShellLevel1HiiHandle, CompareString, L"Goto", ShellCommandGetCurrentScriptFile()->CurrentCommand->Line); + ShellPrintHiiEx( + -1, + -1, + NULL, + STRING_TOKEN (STR_SYNTAX_NO_MATCHING), + gShellLevel1HiiHandle, + CompareString, + L"Goto", + ShellCommandGetCurrentScriptFile()!=NULL + &&ShellCommandGetCurrentScriptFile()->CurrentCommand!=NULL + ?ShellCommandGetCurrentScriptFile()->CurrentCommand->Line:0); ShellStatus = SHELL_NOT_FOUND; } FreePool(CompareString);