Studio: cleanup 'null'-layers before generating errors
This commit is contained in:
parent
d2e7bac775
commit
181965efd9
2 changed files with 11 additions and 0 deletions
|
@ -508,6 +508,9 @@ export class EditThemeState extends EditJsonState<LayoutConfigJson> {
|
||||||
}
|
}
|
||||||
const prepare = this.buildValidation(state)
|
const prepare = this.buildValidation(state)
|
||||||
const context = ConversionContext.construct([], ["prepare"])
|
const context = ConversionContext.construct([], ["prepare"])
|
||||||
|
if(configuration.layers){
|
||||||
|
Utils.NoNullInplace(configuration.layers)
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
prepare.convert(<LayoutConfigJson>configuration, context)
|
prepare.convert(<LayoutConfigJson>configuration, context)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -1649,4 +1649,12 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
||||||
}
|
}
|
||||||
return n + Utils._metrixPrefixes[index]
|
return n + Utils._metrixPrefixes[index]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NoNullInplace(layers: any[]):void {
|
||||||
|
for (let i = layers.length - 1; i >= 0; i--) {
|
||||||
|
if(layers[i] === null || layers[i] === undefined){
|
||||||
|
layers.splice(i, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue