]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLib/UefiShellLib.c
allow for failure return when called without a shell present.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLib / UefiShellLib.c
index d65f427cee93c8b09277268d0d42a2a9700ac029..6d885f4681f51df49d83dcb1986ac1997c698cc1 100644 (file)
@@ -1214,10 +1214,13 @@ ShellGetCurrentDir (
     return (mEfiShellProtocol->GetCurDir(DeviceName));\r
   }\r
   //\r
-  // ASSERT that we must have EFI shell\r
+  // Check for EFI shell\r
   //\r
-  ASSERT(mEfiShellEnvironment2 != NULL);\r
-  return (mEfiShellEnvironment2->CurDir(DeviceName));\r
+  if (mEfiShellEnvironment2 != NULL) {\r
+    return (mEfiShellEnvironment2->CurDir(DeviceName));\r
+  }\r
+\r
+  return (NULL);\r
 }\r
 /**\r
   sets (enabled or disabled) the page break mode\r