fix GrapesJS editable components check for theme blocks
Add null check for window.themeBlocks[blockSlug] before accessing label to prevent errors when block slug exists but has no theme block definition. Update PageBuilderBody dist files with the fix.
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -228,7 +228,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let blockSlug = component.attributes['block-slug'];
|
let blockSlug = component.attributes['block-slug'];
|
||||||
if (blockSlug) {
|
if (blockSlug && window.themeBlocks && window.themeBlocks[blockSlug]) {
|
||||||
let labelHtml = window.themeBlocks[blockSlug]['label'];
|
let labelHtml = window.themeBlocks[blockSlug]['label'];
|
||||||
let labelTextParts = labelHtml.split("</div>");
|
let labelTextParts = labelHtml.split("</div>");
|
||||||
if (labelTextParts.length > 1) {
|
if (labelTextParts.length > 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user