```
TypeError: Cannot read properties of undefined (reading 'map')
at items.action(../../../../../apps/frappe/frappe/public/js/frappe/views/reports/query_report.js:1688:39)
at $link(../../../../../apps/frappe/frappe/public/js/frappe/ui/page.js:506:11)
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)
```
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
```
TypeError: Cannot read properties of undefined (reading 'fields')
at frappe.ui.form.ControlTableMultiSelectget_link_field(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/table_multiselect.js:151:28)
at frappe.ui.form.ControlTableMultiSelectset_formatted_input(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/table_multiselect.js:124:27)
at _a.set_input(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/data.js:247:8)
at update_input(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/base_input.js:89:8)
at _a.refresh_input(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/base_input.js:110:5)
at frappe.ui.form.Controlrefresh(../../../../../apps/frappe/frappe/public/js/frappe/form/controls/base_control.js:140:9)
at frappe.ui.form.Layoutattach_doc_and_docfields(../../../../../apps/frappe/frappe/public/js/frappe/form/layout.js:490:59)
at frappe.ui.form.Layoutrefresh(../../../../../apps/frappe/frappe/public/js/frappe/form/layout.js:344:8)
at frappe.ui.form.Formrefresh_fields(../../../../../apps/frappe/frappe/public/js/frappe/form/form.js:679:15)
at <anonymous>(../../../../../apps/frappe/frappe/public/js/frappe/form/form.js:618:16)```
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Make it more readable, and prevent error
Sentry FRAPPE-4SQ
```
TypeError: Cannot read properties of undefined (reading 'default_letter_head')
at frappe.ui.get_print_settings(../../../../../apps/frappe/frappe/public/js/frappe/form/print_utils.js:6:65)
at items.action(../../../../../apps/frappe/frappe/public/js/frappe/views/reports/query_report.js:1640:29)
at $link(../../../../../apps/frappe/frappe/public/js/frappe/ui/page.js:506:11)
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)```
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Sentry FRAPPE-60X
```
TypeError: this.grid_rows_by_docname is undefined
at Grid.set_value(../../../../../apps/frappe/frappe/public/js/frappe/form/grid.js:793:41)
at fn(../../../../../apps/frappe/frappe/public/js/frappe/form/form.js:317:40)
at o/<(../../../../../apps/frappe/frappe/public/js/frappe/model/model.js:604:27)
```
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Use dict.get(), it'll just return `None` if the key isn't present
(also will handle a `None` key just fine)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Sentry FRAPPE-7VT
Partial revert of 8a7707e3fa
```
UnboundLocalError: cannot access local variable 'message' where it is not associated with a value
File "frappe/app.py", line 114, in application
response = frappe.api.handle(request)
File "frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
File "frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
File "frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
File "frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "__init__.py", line 1768, in call
return fn(*args, **newargs)
File "frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "frappe/desk/form/save.py", line 37, in savedocs
doc.submit()
File "frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "frappe/model/document.py", line 1048, in submit
return self._submit()
File "frappe/model/document.py", line 1031, in _submit
return self.save()
File "frappe/model/document.py", line 337, in save
return self._save(*args, **kwargs)
File "frappe/model/document.py", line 390, in _save
self.run_post_save_methods()
File "frappe/model/document.py", line 1131, in run_post_save_methods
self.run_method("on_submit")
File "frappe/model/document.py", line 964, in run_method
self.run_notifications(method)
File "frappe/model/document.py", line 1024, in run_notifications
_evaluate_alert(alert)
File "frappe/model/document.py", line 1007, in _evaluate_alert
evaluate_alert(self, alert.name, alert.event)
File "frappe/email/doctype/notification/notification.py", line 517, in evaluate_alert
msg = f"<details><summary>{title}</summary>{message}</details>"
```
Signed-off-by: Akhil Narang <me@akhilnarang.dev>