diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 901429915..6f9bc1e17 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -383,6 +383,9 @@ export const preventDefault = (event) => { * @returns The value. */ export const getRefValue = (ref) => { + if (!ref || !ref.current){ + return; + } if (ref.current.type == "checkbox") { return ref.current.checked; } else {