mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-04 11:59:07 +08:00
Fix crash
This commit is contained in:
parent
48811ecb4d
commit
e9c2301b56
@ -98,7 +98,7 @@ namespace FileLocksmith::Interop
|
||||
{
|
||||
HANDLE hStdin = INVALID_HANDLE_VALUE;
|
||||
|
||||
if (!pipeName->Empty)
|
||||
if (pipeName->Length > 0)
|
||||
{
|
||||
std::wstring pipe = from_system_string(pipeName);
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace PowerToys.FileLocksmithUI.ViewModels
|
||||
public MainViewModel()
|
||||
{
|
||||
var args = Environment.GetCommandLineArgs();
|
||||
var pipeName = args.Where(s => s.Contains("\\\\.\\pipe\\")).FirstOrDefault();
|
||||
string pipeName = args.Where(s => s.Contains("\\\\.\\pipe\\")).FirstOrDefault() ?? string.Empty;
|
||||
|
||||
paths = NativeMethods.ReadPathsFromPipe(pipeName);
|
||||
Logger.LogInfo($"Starting FileLocksmith with {paths.Length} files selected.");
|
||||
|
Loading…
Reference in New Issue
Block a user