From 04c116cbec3916ce30695b338d57fb4484909980 Mon Sep 17 00:00:00 2001 From: Dani Horon Date: Thu, 9 May 2024 15:00:16 +0300 Subject: [PATCH] fix: prevent redis provider from crashing when using deleteComplete --- .../Services/RedisPersistenceProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/providers/WorkflowCore.Providers.Redis/Services/RedisPersistenceProvider.cs b/src/providers/WorkflowCore.Providers.Redis/Services/RedisPersistenceProvider.cs index 6bf8df875..eb76fa29e 100644 --- a/src/providers/WorkflowCore.Providers.Redis/Services/RedisPersistenceProvider.cs +++ b/src/providers/WorkflowCore.Providers.Redis/Services/RedisPersistenceProvider.cs @@ -92,6 +92,10 @@ public Task> GetWorkflowInstances(WorkflowStatus? public async Task GetWorkflowInstance(string Id, CancellationToken _ = default) { var raw = await _redis.HashGetAsync($"{_prefix}.{WORKFLOW_SET}", Id); + if (!raw.HasValue) + { + return null; + } return JsonConvert.DeserializeObject(raw, _serializerSettings); }