Skip to content

[Correctness] ServiceValidator.cs — ExecutablePath not validated in ValidateDto #512

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Warning

File: src/Servy.Core/Helpers/ServiceValidator.cs

Description:
ValidateDto checks name length, display name length, description length, argument lengths, and numeric bounds — but does not validate dto.ExecutablePath (a required field). A null or empty ExecutablePath passes validation and gets stored in the database.

The SQL schema marks ExecutablePath TEXT NOT NULL, so the DB rejects null, but empty string passes. This later causes a NullReferenceException or empty-path error deep in StartProcess.

Suggested fix:
Add a validation check for string.IsNullOrWhiteSpace(dto.ExecutablePath) with a user-friendly error message.

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