diff --git a/lib/src/form/src/controller.dart b/lib/src/form/src/controller.dart index e1f7811..b66dda8 100644 --- a/lib/src/form/src/controller.dart +++ b/lib/src/form/src/controller.dart @@ -123,10 +123,9 @@ class AstromicFormController extends FormController { /// Remove the value of a hosted state variable using it's ID. void removeValue(String id) { - if (!_hostedValues.keys.toList().contains(id)) { - throw Exception('Value of id `$id` not found to be removed.'); + if (_hostedValues.keys.toList().contains(id)) { + _hostedValues.remove(id); } - _hostedValues.remove(id); } /// Validate hosted values.