Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'cells')#1912

Merged
BryanValverdeU merged 3 commits intomasterfrom
u/bvalverde/fixUnhandledExc
Jun 23, 2023
Merged

Uncaught TypeError: Cannot read properties of undefined (reading 'cells')#1912
BryanValverdeU merged 3 commits intomasterfrom
u/bvalverde/fixUnhandledExc

Conversation

@BryanValverdeU
Copy link
Contributor

@BryanValverdeU BryanValverdeU commented Jun 23, 2023

Fix Uncaught TypeError: Cannot read properties of undefined (reading 'cells')

Callstack
webpack://.../roosterjs-editor-plugins/lib/plugins/TableResize/editors/TableEditor.ts cells 117
webpack://.../roosterjs-editor-plugins/lib/plugins/TableResize/TableResize.ts onMouseMove 125
webpack://.../roosterjs-editor-core/lib/coreApi/attachDomEvent.ts beforeDispatch 27

Do not create the TableEditor if the table do not have rows. to prevent the issue. Also add a null check on the line that cause the regression

@juliaroldi
Copy link
Contributor

Do you know which scenario this files can be undefined?

@BryanValverdeU
Copy link
Contributor Author

BryanValverdeU commented Jun 23, 2023

Do you know which scenario this files can be undefined?

A table with no rows it looks like. I am able to repro adding <table></table> and mouse over it.
I dont know why would someone add a table like that though

@juliaroldi
Copy link
Contributor

Do you know which scenario this files can be undefined?

A table with no rows it looks like. I am able to repro adding <table></table> and mouse over it. I dont know why would someone add a table like that though

Do you if some issue is just deleting the cells and not the table element?

@BryanValverdeU
Copy link
Contributor Author

Do you know which scenario this files can be undefined?

A table with no rows it looks like. I am able to repro adding <table></table> and mouse over it. I dont know why would someone add a table like that though

Do you if some issue is just deleting the cells and not the table element?

I think when that happens we delete the table

@BryanValverdeU BryanValverdeU merged commit 6866b5b into master Jun 23, 2023
@BryanValverdeU BryanValverdeU deleted the u/bvalverde/fixUnhandledExc branch June 23, 2023 18:15
BryanValverdeU added a commit that referenced this pull request Jun 23, 2023
…ls') (#1912)

* fix

* do not create the table editor if no rows

* fix
BryanValverdeU added a commit that referenced this pull request Jun 23, 2023
…ls') (#1912)

* fix

* do not create the table editor if no rows

* fix
BryanValverdeU added a commit that referenced this pull request Jun 23, 2023
* Uncaught TypeError: Cannot read properties of undefined (reading 'cells') (#1912)

* fix

* do not create the table editor if no rows

* fix

* bump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants