]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLib/UefiShellLib.c
Merge branch 'master' of https://github.com/tianocore/edk2
[mirror_edk2.git] / ShellPkg / Library / UefiShellLib / UefiShellLib.c
index 70852a93f298097023a1f49791f1911a9a414d1f..35a1a7169c8b9dbdf7b287052a6fb34eb57f2cee 100644 (file)
@@ -373,6 +373,8 @@ EFIAPI
 ShellInitialize (\r
   )\r
 {\r
+  EFI_STATUS Status;\r
+\r
   //\r
   // if auto initialize is not false then skip\r
   //\r
@@ -383,7 +385,8 @@ ShellInitialize (
   //\r
   // deinit the current stuff\r
   //\r
-  ASSERT_EFI_ERROR(ShellLibDestructor(gImageHandle, gST));\r
+  Status = ShellLibDestructor (gImageHandle, gST);\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
   // init the new stuff\r
@@ -4071,7 +4074,7 @@ ShellFileHandleReturnLine(
     Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);\r
 \r
   }\r
-  if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) {\r
+  if (Status == EFI_END_OF_FILE && RetVal != NULL && *RetVal != CHAR_NULL) {\r
     Status = EFI_SUCCESS;\r
   }\r
   if (EFI_ERROR(Status) && (RetVal != NULL)) {\r