From e0329febc4c9e16018288997ec15e3ffe5f83354 Mon Sep 17 00:00:00 2001 From: Jakob Gerstmayer Date: Fri, 25 Oct 2019 11:43:18 +0200 Subject: [PATCH 1/4] Added check to make sure extent array has four objects. --- src/ol/format/filter/Bbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/format/filter/Bbox.js b/src/ol/format/filter/Bbox.js index 04455a28df..abcb11e1e7 100644 --- a/src/ol/format/filter/Bbox.js +++ b/src/ol/format/filter/Bbox.js @@ -30,7 +30,11 @@ class Bbox extends Filter { /** * @type {import("../../extent.js").Extent} */ - this.extent = extent; + if(extent.length === 4) { + this.extent = extent; + } else { + throw new Error('Error: Extent should look like this: [minx, miny, maxx, maxy]'); + } /** * @type {string|undefined} From 37cbb8e43eb3aaa26a25211cfee294371d4ee4dd Mon Sep 17 00:00:00 2001 From: Jakob Gerstmayer Date: Fri, 25 Oct 2019 12:06:15 +0200 Subject: [PATCH 2/4] fixed spacing issues --- src/ol/format/filter/Bbox.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ol/format/filter/Bbox.js b/src/ol/format/filter/Bbox.js index abcb11e1e7..d45a20982a 100644 --- a/src/ol/format/filter/Bbox.js +++ b/src/ol/format/filter/Bbox.js @@ -30,11 +30,11 @@ class Bbox extends Filter { /** * @type {import("../../extent.js").Extent} */ - if(extent.length === 4) { - this.extent = extent; - } else { - throw new Error('Error: Extent should look like this: [minx, miny, maxx, maxy]'); - } + if (extent.length === 4) { + this.extent = extent; + } else { + throw new Error('Error: Extent should look like this: [minx, miny, maxx, maxy]'); + } /** * @type {string|undefined} From bc34fe5b71b7375a3aac9b1d66d6ce0f365d4146 Mon Sep 17 00:00:00 2001 From: Jakob Gerstmayer Date: Mon, 28 Oct 2019 12:51:40 +0100 Subject: [PATCH 3/4] incorporated suggestions --- src/ol/format/filter/Bbox.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ol/format/filter/Bbox.js b/src/ol/format/filter/Bbox.js index d45a20982a..f95f81d0e5 100644 --- a/src/ol/format/filter/Bbox.js +++ b/src/ol/format/filter/Bbox.js @@ -30,10 +30,9 @@ class Bbox extends Filter { /** * @type {import("../../extent.js").Extent} */ - if (extent.length === 4) { this.extent = extent; - } else { - throw new Error('Error: Extent should look like this: [minx, miny, maxx, maxy]'); + if (extent.length !== 4) { + throw new Error('Expected an extent with four values ([minX, minY, maxX, maxY])'); } /** From 66521926476a32643f6caec500f2de55c0fe219a Mon Sep 17 00:00:00 2001 From: Jakob Gerstmayer Date: Mon, 28 Oct 2019 12:55:26 +0100 Subject: [PATCH 4/4] fixed spacing issues (again) --- src/ol/format/filter/Bbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/format/filter/Bbox.js b/src/ol/format/filter/Bbox.js index f95f81d0e5..736abadcfc 100644 --- a/src/ol/format/filter/Bbox.js +++ b/src/ol/format/filter/Bbox.js @@ -30,7 +30,7 @@ class Bbox extends Filter { /** * @type {import("../../extent.js").Extent} */ - this.extent = extent; + this.extent = extent; if (extent.length !== 4) { throw new Error('Expected an extent with four values ([minX, minY, maxX, maxY])'); }