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/edk2@11894 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-06-27 16:45:41 +00:00
parent febb227679
commit 8bd282bee9
1 changed files with 6 additions and 3 deletions

View File

@ -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