From c05cccf1587b11071d9f6aea9d3cd6edb67711d2 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Fri, 17 May 2024 15:13:53 +0200 Subject: [PATCH] fix(worker): throw error for empty container response (#88) This commit ensures that an error is returned to the gateway when the runner container returns a successful but empty response. --- worker/worker.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/worker/worker.go b/worker/worker.go index 3698c6ae..583519c6 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -194,6 +194,11 @@ func (w *Worker) ImageToVideo(ctx context.Context, req ImageToVideoMultipartRequ return nil, errors.New("image-to-video container returned 500") } + if resp.JSON200 == nil { + slog.Error("image-to-video container returned no content") + return nil, errors.New("image-to-video container returned no content") + } + return resp.JSON200, nil }