Index: ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
===================================================================
--- ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c	(revision 14622)
+++ ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c	(working copy)
@@ -84,9 +84,9 @@
     //
     // if we got an error free the memory and return NULL
     //
-    if (EFI_ERROR(Status)) {
+    if (EFI_ERROR(Status) && (FileInfo != NULL)) {
       FreePool(FileInfo);
-      return NULL;
+      FileInfo = NULL;
     }
   }
   return (FileInfo);
