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

View File

@ -1214,11 +1214,14 @@ ShellGetCurrentDir (
return (mEfiShellProtocol->GetCurDir(DeviceName)); return (mEfiShellProtocol->GetCurDir(DeviceName));
} }
// //
// ASSERT that we must have EFI shell // Check for EFI shell
// //
ASSERT(mEfiShellEnvironment2 != NULL); if (mEfiShellEnvironment2 != NULL) {
return (mEfiShellEnvironment2->CurDir(DeviceName)); return (mEfiShellEnvironment2->CurDir(DeviceName));
} }
return (NULL);
}
/** /**
sets (enabled or disabled) the page break mode sets (enabled or disabled) the page break mode