ContentTools icon indicating copy to clipboard operation
ContentTools copied to clipboard

Wrong condition order in Paragraph tool

Open magiksd opened this issue 7 years ago • 1 comments

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 avatar Nov 15 '18 10:11 magiksd

@magiksd thank you! :+1:

anthonyjb avatar Nov 21 '18 15:11 anthonyjb