mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 02:39:22 +08:00
Add Empty Check for GetEnvironmentVariable Method.
This commit is contained in:
parent
d4641b45ac
commit
6870e03ffe
@ -299,7 +299,7 @@ namespace Wox.Infrastructure
|
|||||||
{
|
{
|
||||||
string oldCwd = Environment.CurrentDirectory;
|
string oldCwd = Environment.CurrentDirectory;
|
||||||
string home = Environment.GetEnvironmentVariable("USERPROFILE");
|
string home = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||||
Environment.CurrentDirectory = home;
|
if(!string.IsNullOrEmpty(home)) Environment.CurrentDirectory = home;
|
||||||
ShellExecCmdLine(
|
ShellExecCmdLine(
|
||||||
IntPtr.Zero,
|
IntPtr.Zero,
|
||||||
errorDialogHwnd,
|
errorDialogHwnd,
|
||||||
@ -308,7 +308,7 @@ namespace Wox.Infrastructure
|
|||||||
global::System.Diagnostics.ProcessWindowStyle.Normal,
|
global::System.Diagnostics.ProcessWindowStyle.Normal,
|
||||||
ShellExecCmdLineFlags.SECL__IGNORE_ERROR | ShellExecCmdLineFlags.SECL_USE_IDLIST | ShellExecCmdLineFlags.SECL_LOG_USAGE | (showErrorDialog ? 0 : ShellExecCmdLineFlags.SECL_NO_UI)
|
ShellExecCmdLineFlags.SECL__IGNORE_ERROR | ShellExecCmdLineFlags.SECL_USE_IDLIST | ShellExecCmdLineFlags.SECL_LOG_USAGE | (showErrorDialog ? 0 : ShellExecCmdLineFlags.SECL_NO_UI)
|
||||||
);
|
);
|
||||||
Environment.CurrentDirectory = oldCwd;
|
if (!string.IsNullOrEmpty(home)) Environment.CurrentDirectory = oldCwd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Device not ready 0x80070015
|
{ // Device not ready 0x80070015
|
||||||
|
Loading…
Reference in New Issue
Block a user