SHELL_FILE_HANDLE OriginalStdOut;\r
SHELL_FILE_HANDLE OriginalStdErr;\r
SYSTEM_TABLE_INFO OriginalSystemTableInfo;\r
+ CONST SCRIPT_FILE *ConstScriptFile;\r
\r
//\r
// Update the StdIn, StdOut, and StdErr for redirection to environment variables, files, etc... unicode and ASCII\r
// Now print errors\r
//\r
if (EFI_ERROR(Status)) {\r
- if (ShellCommandGetCurrentScriptFile() == NULL || ShellCommandGetCurrentScriptFile()->CurrentCommand == NULL) {\r
+ ConstScriptFile = ShellCommandGetCurrentScriptFile();\r
+ if (ConstScriptFile == NULL || ConstScriptFile->CurrentCommand == NULL) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));\r
} else {\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status), ShellCommandGetCurrentScriptFile()->CurrentCommand->Line);\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR_SCRIPT), ShellInfoObject.HiiHandle, (VOID*)(Status), ConstScriptFile->CurrentCommand->Line);\r
}\r
}\r
\r