From cb2fa2fb0c6582524e28330789de30a35118049d Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 21 Nov 2023 17:44:53 +1300 Subject: [PATCH] Fix error when saving a set with no weight Just default it to zero if it isn't entered. --- EditSet.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EditSet.tsx b/EditSet.tsx index 0528016..e552a21 100644 --- a/EditSet.tsx +++ b/EditSet.tsx @@ -99,7 +99,7 @@ export default function EditSet() { const handleSubmit = async () => { if (!name) return; - let newWeight = Number(weight); + let newWeight = Number(weight || 0); let newUnit = unit; if (settings.autoConvert && unit !== settings.autoConvert) { newUnit = settings.autoConvert;