diff --git a/bin/web/js/layer.js b/bin/web/js/layer.js index 4ccb295..f36d116 100644 --- a/bin/web/js/layer.js +++ b/bin/web/js/layer.js @@ -463,11 +463,14 @@ const Layer = function(tp, layerID, fontsAndAxes, autoInit = true) { const panelProp= tp.getPanelPropTitle(propName); const panelPropMom = tp.getPanelPropContainer(panelProp); const newValue = active ? getArtboard().theatreObject.value.width : 0; + const textWrappingButton = tp.getPanel().querySelector('.textWrappingButton'); + + if (panelPropMom !== null && textWrappingButton !== null) { if (active) { panelPropMom.style.display = 'flex'; - tp.getPanel().querySelector('.textWrappingButton').classList.add('active'); + textWrappingButton.classList.add('active'); } else { - tp.getPanel().querySelector('.textWrappingButton').classList.remove('active'); + textWrappingButton.classList.remove('active'); panelPropMom.style.display = 'none'; } @@ -478,6 +481,7 @@ const Layer = function(tp, layerID, fontsAndAxes, autoInit = true) { set(this.theatreObject.props[propName], newValue); }); } + } } };