diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-27 16:45:41 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-27 16:45:41 +0000 |
commit | 604a6448bf232ada50898a8b2aad629a411184b6 (patch) | |
tree | bcffb00d8956738851d5ab074d477356b49aa8dc /edk2/ShellPkg | |
parent | bbae519d62cd23d38167be9bdb08c5f33171d4ec (diff) |
allow for failure return when called without a shell present.
signed-off-by: jcarsey
reviewed-by: lgrosenb
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@11894 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'edk2/ShellPkg')
-rw-r--r-- | edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c index d65f427ce..6d885f468 100644 --- a/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -1214,10 +1214,13 @@ ShellGetCurrentDir ( return (mEfiShellProtocol->GetCurDir(DeviceName));
}
//
- // ASSERT that we must have EFI shell
+ // Check for EFI shell
//
- ASSERT(mEfiShellEnvironment2 != NULL);
- return (mEfiShellEnvironment2->CurDir(DeviceName));
+ if (mEfiShellEnvironment2 != NULL) {
+ return (mEfiShellEnvironment2->CurDir(DeviceName));
+ }
+
+ return (NULL);
}
/**
sets (enabled or disabled) the page break mode
|