We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description The code snippet in the resize.ts file clones the parent element of a header cell in the grid using the following line:
const headerTextClone: Element = (<HTMLElement>headerTable.querySelector('[e-mappinguid="' + uid + '"]').parentElement.cloneNode(true));
If the parentElement is null or the selector does not match any element, this could result in a runtime error.
Uncaught TypeError: Cannot read properties of null (reading 'parentElement') at Resize2.resizeColumn (resize.js:115:87) at Resize2.findColumn (resize.js:242:22) at Resize2.autoFitColumns (resize.js:68:14) at Resize2.autoFit (resize.js:80:18) at Observer2.notify (observer.js:102:29) at Component2.notify (component.js:338:32) at content-renderer.js:78:30 at util.js:63:13
Expected Behavior The cloning operation should be efficient, safe, and handle edge cases (e.g., when parentElement is null).
Suggested Fix Add a null-check for parentElement before attempting to clone it
const headerCell = headerTable.querySelector('[e-mappinguid="' + uid + '"]'); const parentElement = headerCell ? headerCell.parentElement : null; if (parentElement) { const headerTextClone: Element = parentElement.cloneNode(true); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
The code snippet in the resize.ts file clones the parent element of a header cell in the grid using the following line:
If the parentElement is null or the selector does not match any element, this could result in a runtime error.
Expected Behavior
The cloning operation should be efficient, safe, and handle edge cases (e.g., when parentElement is null).
Suggested Fix
Add a null-check for parentElement before attempting to clone it
The text was updated successfully, but these errors were encountered: