Add validation for empty plugin ID and server URL

This commit is contained in:
Thorsten Sommer 2025-06-02 20:20:35 +02:00
parent 6979a73e5c
commit 650a27fed1
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -7,6 +7,9 @@ public static partial class PluginFactory
{ {
public static async Task<EntityTagHeaderValue?> DetermineConfigPluginETagAsync(Guid configPlugId, string configServerUrl, CancellationToken cancellationToken = default) public static async Task<EntityTagHeaderValue?> DetermineConfigPluginETagAsync(Guid configPlugId, string configServerUrl, CancellationToken cancellationToken = default)
{ {
if(configPlugId == Guid.Empty || string.IsNullOrWhiteSpace(configServerUrl))
return null;
try try
{ {
var serverUrl = configServerUrl.EndsWith('/') ? configServerUrl[..^1] : configServerUrl; var serverUrl = configServerUrl.EndsWith('/') ? configServerUrl[..^1] : configServerUrl;