Fixed issue where an exception is raised if KEYS() finds no matches and returns null (#733)

This commit is contained in:
Graham Murt 2024-03-08 14:26:35 +00:00 committed by GitHub
parent b9fcc04647
commit ec5a804576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,14 +265,17 @@ end;
procedure TMVCCacheController.DeleteCacheKey(const AKey: string = '');
var
AKeys: TArray<string>;
AKeys: TRedisArray;
ARedis: IRedisClient;
begin
ARedis := RedisClient;
if AKey <> '' then
begin
AKeys := ARedis.KEYS(AKey).ToArray;
ARedis.DEL(AKeys);
AKeys := ARedis.KEYS(AKey);
if AKeys.HasValue then
begin
ARedis.DEL(AKeys.ToArray);
end;
end
else
begin