From 33fa731529e088caceb7786501d3ecf72285f909 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Wed, 19 Feb 2020 11:36:56 -0800 Subject: [PATCH] Add guard around dialog onConfirm --- src/ui/dialogs/Dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/dialogs/Dialog.js b/src/ui/dialogs/Dialog.js index 1851a3b1..bce8a99c 100644 --- a/src/ui/dialogs/Dialog.js +++ b/src/ui/dialogs/Dialog.js @@ -93,7 +93,10 @@ export default function Dialog({ const onSubmitForm = useCallback( e => { e.preventDefault(); - onConfirm(e); + + if (onConfirm) { + onConfirm(e); + } }, [onConfirm] );