Skip to content
New issue

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

fix: TypeError: Cannot read properties of null (reading 'classList') #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akhilnarang
Copy link
Member

Sentry PRESS-4KJ / Support 10958

Not sure if this is "correct"

Sentry PRESS-4KJ / Support 10958

TypeError: Cannot read properties of null (reading 'classList')
  at ? (../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2940:37)
  at Array.forEach(<anonymous>)
  at Ye.clearSelection(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2940:14)
  at Ye._selectArea(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2877:14)
  at Ye.selectArea(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2865:18)
  at HTMLDivElement.t(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:2723:18)
  at invokeFunc(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:632:19)
  at trailingEdge(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:681:14)
  at timerExpired(../../../../../apps/frappe/node_modules/frappe-datatable/dist/frappe-datatable.cjs.js:669:14)
  at r(../../../../../apps/frappe/node_modules/src/helpers.ts:98:1)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
@@ -391,8 +391,11 @@ export default class CellManager {

clearSelection() {
(this._selectedCells || [])
.forEach($cell => $cell.classList.remove('dt-cell--highlight'));

.forEach($cell => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem correct. The real problem is this array containing null... why does that happen?

if that root cause is harmless then fix is fine.

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.

None yet

2 participants