diff --git a/UI/Base/Combine.ts b/UI/Base/Combine.ts index 275da44b1..827e30e3f 100644 --- a/UI/Base/Combine.ts +++ b/UI/Base/Combine.ts @@ -17,7 +17,16 @@ export default class Combine extends UIElement { } InnerRender(): string { - return this.uiElements.map(ui => ui.Render()).join(""); + return this.uiElements.map(ui => { + if(ui === undefined || ui === null){ + return ""; + } + if(ui.Render === undefined){ + console.error("Not a UI-element", ui); + return ""; + } + return ui.Render(); + }).join(""); } } \ No newline at end of file diff --git a/UI/CustomGenerator/SingleSetting.ts b/UI/CustomGenerator/SingleSetting.ts index fdf3c1604..dbb4ff145 100644 --- a/UI/CustomGenerator/SingleSetting.ts +++ b/UI/CustomGenerator/SingleSetting.ts @@ -48,7 +48,6 @@ export default class SingleSetting { for (const pathPart of path) { let newConfigPart = configPart[pathPart]; if (newConfigPart === undefined) { - console.warn("Lost the way for path ", path, " - creating entry") if (typeof (pathPart) === "string") { configPart[pathPart] = {}; } else { diff --git a/UI/CustomGenerator/TagRenderingPreview.ts b/UI/CustomGenerator/TagRenderingPreview.ts index 4a1675981..e728912a5 100644 --- a/UI/CustomGenerator/TagRenderingPreview.ts +++ b/UI/CustomGenerator/TagRenderingPreview.ts @@ -34,12 +34,17 @@ export default class TagRenderingPreview extends UIElement { let es = tagRenderingPanel.GetValue(); let rendering: UIElement; + const self = this; try { rendering = new VariableUiElement(es.map(tagRenderingConfig => { - const tr = FromJSON.TagRendering(tagRenderingConfig, "preview") - .construct({tags: this.previewTagValue}); - return tr.Render(); + try { + const tr = FromJSON.TagRendering(tagRenderingConfig, "preview") + .construct({tags: self.previewTagValue}); + return tr.Render(); + } catch (e) { + return new Combine(["Could not show this tagrendering:", e.message]).Render(); + } } )); diff --git a/UI/Input/TextField.ts b/UI/Input/TextField.ts index 4b80ebf5d..d1d25240e 100644 --- a/UI/Input/TextField.ts +++ b/UI/Input/TextField.ts @@ -37,7 +37,6 @@ export class TextField extends InputElement { self.IsSelected.setData(true) }); this.value.addCallback((t) => { - console.log("Setting actual value to", t); const field = document.getElementById("txt-"+this.id); if (field === undefined || field === null) { return; diff --git a/UI/Input/ValidatedTextField.ts b/UI/Input/ValidatedTextField.ts index ab6510f0d..056d09a6b 100644 --- a/UI/Input/ValidatedTextField.ts +++ b/UI/Input/ValidatedTextField.ts @@ -271,7 +271,7 @@ export default class ValidatedTextField { country?: string }): InputElement { let textField: InputElement; - if (options.type) { + if (options?.type) { textField = ValidatedTextField.InputForType(options.type, options); } else { textField = new TextField(options); diff --git a/UI/TagRendering.ts b/UI/TagRendering.ts index 20928cd34..af29c0758 100644 --- a/UI/TagRendering.ts +++ b/UI/TagRendering.ts @@ -493,6 +493,7 @@ export class TagRendering extends UIElement implements TagDependantUIElement { if (this.IsKnown()) { const answer = this.RenderAnswer(); + if (answer.IsEmpty()) { return ""; }