Skip to content

Commit ecd5b89

Browse files
fix: Null check
1 parent 2864529 commit ecd5b89

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

builder/builder/doctype/builder_page/builder_page.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ def set_dynamic_content_placeholder(block, data_key=False):
654654
"style"
655655
] += f"{css_property}: {{{{ {key} or '{escape_single_quotes(block['baseStyles'].get(_property, '') or '')}' }}}};"
656656
elif _type == "key" and not block.get("isRepeaterBlock"):
657-
block[_property] = f"{{{{ {key} or '{escape_single_quotes(block.get(_property, ''))}' }}}}"
657+
block[
658+
_property
659+
] = f"{{{{ {key} if {key} is not none else '{escape_single_quotes(block.get(_property, ''))}' }}}}"
658660

659661

660662
@redis_cache(ttl=60 * 60)

frontend/src/components/BuilderBlock.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const attributes = computed(() => {
120120
if (props.data) {
121121
if (props.block.getDataKey("type") === "attribute") {
122122
attribs[props.block.getDataKey("property") as string] =
123-
getDataForKey(props.data, props.block.getDataKey("key")) ||
123+
getDataForKey(props.data, props.block.getDataKey("key")) ??
124124
attribs[props.block.getDataKey("property") as string];
125125
}
126126
}

frontend/src/components/TextBlock.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const textContent = computed(() => {
216216
let innerHTML = props.block.getInnerHTML();
217217
if (props.data) {
218218
if (props.block.getDataKey("property") === "innerHTML") {
219-
innerHTML = getDataForKey(props.data, props.block.getDataKey("key")) || innerHTML;
219+
innerHTML = getDataForKey(props.data, props.block.getDataKey("key")) ?? innerHTML;
220220
}
221221
}
222222
return String(innerHTML ?? "");

0 commit comments

Comments
 (0)