From 5e43e5bce92e5e69c6330c89c2460bcdbd097230 Mon Sep 17 00:00:00 2001 From: tomasmatus Date: Tue, 12 Nov 2024 12:56:04 +0100 Subject: [PATCH] lib: check for null instead of undefined `exit_status` won't be undefined as it is set to `null` when checked for undefined for the first time. --- pkg/lib/cockpit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lib/cockpit.js b/pkg/lib/cockpit.js index a529fe060e56..19b88a6e597c 100644 --- a/pkg/lib/cockpit.js +++ b/pkg/lib/cockpit.js @@ -1407,7 +1407,7 @@ function factory() { this.message = cockpit.message(options.problem); else if (this.exit_signal !== null) this.message = cockpit.format(_("$0 killed with signal $1"), name, this.exit_signal); - else if (this.exit_status !== undefined) + else if (this.exit_status !== null) this.message = cockpit.format(_("$0 exited with code $1"), name, this.exit_status); else this.message = cockpit.format(_("$0 failed"), name);