Skip to content

ResolvePath returns whitespace-only strings as valid paths #320

@Christophe-Rogiers

Description

@Christophe-Rogiers

Description

In src/Servy.Core/Helpers/ProcessHelper.cs (lines 258–260):

public static string? ResolvePath(string? inputPath)
{
    if (string.IsNullOrWhiteSpace(inputPath)) return inputPath;

When inputPath is " " (whitespace only), IsNullOrWhiteSpace returns true and the method returns the whitespace string instead of null. Callers in StartOptionsParser.Parse (lines 47–49, 64–66) pass this directly to ProcessStartInfo.WorkingDirectory or ProcessStartInfo.FileName, causing cryptic process launch failures.

Severity

Warning — whitespace-only paths from the database cause confusing downstream errors.

Suggested fix

Return null instead of the original whitespace string:

if (string.IsNullOrWhiteSpace(inputPath)) return null;

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions