fix: errors

This commit is contained in:
Artemy 2023-07-05 15:50:34 +03:00
parent b6fa1f5d3d
commit 14a250323d
3 changed files with 5 additions and 5 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "cimengine-build-tools",
"version": "1.2.0",
"version": "1.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cimengine-build-tools",
"version": "1.2.0",
"version": "1.2.1",
"license": "MIT",
"dependencies": {
"@turf/turf": "^6.5.0",

View file

@ -1,6 +1,6 @@
{
"name": "cimengine-build-tools",
"version": "1.2.0",
"version": "1.2.1",
"description": "Geojson data processing tools for CIMEngine",
"main": "index.js",
"scripts": {

View file

@ -43,9 +43,9 @@ for (country of layers) {
);
co_features.features = co_features.features.map((val) => {
if (val.geometry.type == "Polygon") {
if (val?.geometry?.type == "Polygon") {
val.properties = {};
} else if (val.geometry.type == "MultiPolygon") {
} else if (val?.geometry?.type == "MultiPolygon") {
console.error("Error: MultiPolygons are not allowed!");
process.exit(1);
}