Skip to content

Commit

Permalink
fix(grid_row): don't crash when undefined
Browse files Browse the repository at this point in the history
TypeError: Cannot read properties of undefined (reading 'fields')
  at frappe.ui.form.ControlTable.get_field(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/table.js:120:18)
  at HTMLInputElement.<anonymous>(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/table.js:46:13)
  at jQuery.event.dispatch(../../../../../apps/frappe/node_modules/jquery/dist/jquery.js:5135:27)
  at elemData.handle(../../../../../apps/frappe/node_modules/jquery/dist/jquery.js:4939:28)
  at sentryWrapped(../../../../../apps/frappe/node_modules/src/helpers.ts:98:1)

Sentry FRAPPE-698

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 0892609)
  • Loading branch information
akhilnarang authored and mergify[bot] committed May 16, 2024
1 parent 6b25854 commit 0f91073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/controls/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ frappe.ui.form.ControlTable = class ControlTable extends frappe.ui.form.Control
get_field(field_name) {
let fieldname;
field_name = field_name.toLowerCase();
this.grid.meta.fields.some((field) => {
this.grid?.meta?.fields.some((field) => {
if (frappe.model.no_value_type.includes(field.fieldtype)) {
return false;
}
Expand Down

0 comments on commit 0f91073

Please sign in to comment.