From fbdcdec1d27ca4b9f7366e97c6b6e7d589181f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Tue, 19 Nov 2024 23:32:56 +0100 Subject: [PATCH] Do not post undefined comments Issue: https://progress.opensuse.org/issues/170089 --- assets/javascripts/openqa.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/openqa.js b/assets/javascripts/openqa.js index 58c60e9292c..70467dd4936 100644 --- a/assets/javascripts/openqa.js +++ b/assets/javascripts/openqa.js @@ -254,7 +254,9 @@ function restartJob(ajaxUrl, jobIds, comment) { addFlash('danger', errorMessage); }; const body = new FormData(); - body.append('comment', comment); + if (comment !== undefined) { + body.append('comment', comment); + } return fetchWithCSRF(ajaxUrl, {method: 'POST', body: body}) .then(response => { if (!response.ok) throw `Server returned ${response.status}: ${response.statusText}`;