ContentTools
ContentTools copied to clipboard
Wrong condition order in Paragraph tool
Hello, while reading how tools are made in CT, I noticed that the method "canApply" in the Paragraph tool could possibly throw an error if the element is undefined.
That's because the "element" variable is used before being tested if defined, so the call to "element.isFixed()" will throw an error if "element" is undefined.
You should write instead :
return element != undefined and not element.isFixed();
@magiksd thank you! :+1: