diff --git a/src/errorHandling.ts b/src/errorHandling.ts index 73549070..372d160f 100644 --- a/src/errorHandling.ts +++ b/src/errorHandling.ts @@ -44,7 +44,7 @@ function getToastProps(errorLogObj: ErrorLog) { }; // @ts-ignore - if (!frappe.SystemSettings.autoReportErrors) { + if (!frappe.SystemSettings?.autoReportErrors) { Object.assign(props, { actionText: t`Report Error`, action: () => { @@ -77,7 +77,7 @@ export function handleError( frappe.errorLog.push(errorLogObj); // @ts-ignore - if (frappe.SystemSettings.autoReportErrors) { + if (frappe.SystemSettings?.autoReportErrors) { reportError(errorLogObj); } else { showToast(getToastProps(errorLogObj)); diff --git a/src/utils.js b/src/utils.js index 7053683b..8a75f3a7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -3,7 +3,8 @@ import Toast from '@/components/Toast'; import router from '@/router'; import { ipcRenderer } from 'electron'; import frappe from 'frappe'; -import { isPesa, t } from 'frappe/utils'; +import { t } from 'frappe'; +import { isPesa } from 'frappe/utils'; import lodash from 'lodash'; import Vue from 'vue'; import { handleErrorWithDialog } from './errorHandling';