From b751f7e7930dacfbb13d3901e4b87295c28dc2ee Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Fri, 9 Sep 2022 12:04:50 +0100 Subject: [PATCH] Parameters widget: protect against negative $depth --- core/modules/widgets/parameters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/widgets/parameters.js b/core/modules/widgets/parameters.js index 0e230303f..ef62ef4b5 100644 --- a/core/modules/widgets/parameters.js +++ b/core/modules/widgets/parameters.js @@ -42,7 +42,7 @@ Compute the internal state of the widget */ ParametersWidget.prototype.execute = function() { var self = this; - this.parametersDepth = parseInt(this.getAttribute("$depth","1"),10) || 1; + this.parametersDepth = Math.max(parseInt(this.getAttribute("$depth","1"),10) || 1,1); // Find the parent transclusions var pointer = this.parentWidget, depth = this.parametersDepth;