forked from MapComplete/MapComplete
Fix generateLayerOverviews
This commit is contained in:
parent
98c40822a2
commit
8ae679d075
2 changed files with 7 additions and 3 deletions
|
@ -38,8 +38,8 @@ export abstract class Conversion<TIn, TOut> {
|
||||||
abstract convert(json: TIn, context: string): { result: TOut, errors?: string[], warnings?: string[], information?: string[] }
|
abstract convert(json: TIn, context: string): { result: TOut, errors?: string[], warnings?: string[], information?: string[] }
|
||||||
|
|
||||||
public convertAll(jsons: TIn[], context: string): { result: TOut[], errors: string[], warnings: string[], information?: string[] } {
|
public convertAll(jsons: TIn[], context: string): { result: TOut[], errors: string[], warnings: string[], information?: string[] } {
|
||||||
if(jsons === undefined){
|
if(jsons === undefined || jsons === null){
|
||||||
throw "convertAll received undefined - don't do this (at "+context+")"
|
throw "convertAll received undefined or null - don't do this (at "+context+")"
|
||||||
}
|
}
|
||||||
const result = []
|
const result = []
|
||||||
const errors = []
|
const errors = []
|
||||||
|
@ -105,7 +105,7 @@ export class OnEveryConcat<X, T> extends DesugaringStep<T> {
|
||||||
const step = this.step
|
const step = this.step
|
||||||
const key = this.key;
|
const key = this.key;
|
||||||
const values = json[key]
|
const values = json[key]
|
||||||
if (values === undefined) {
|
if (values === undefined || values === null) {
|
||||||
// Move on - nothing to see here!
|
// Move on - nothing to see here!
|
||||||
return {
|
return {
|
||||||
result: json,
|
result: json,
|
||||||
|
|
|
@ -307,6 +307,10 @@ class ExpandRewrite<T> extends Conversion<T | RewritableConfigJson<T>, T[]> {
|
||||||
|
|
||||||
convert(json: T | RewritableConfigJson<T>, context: string): { result: T[]; errors?: string[]; warnings?: string[]; information?: string[] } {
|
convert(json: T | RewritableConfigJson<T>, context: string): { result: T[]; errors?: string[]; warnings?: string[]; information?: string[] } {
|
||||||
|
|
||||||
|
if(json === null || json === undefined){
|
||||||
|
return {result: []}
|
||||||
|
}
|
||||||
|
|
||||||
if (json["rewrite"] === undefined) {
|
if (json["rewrite"] === undefined) {
|
||||||
|
|
||||||
// not a rewrite
|
// not a rewrite
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue