2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 18:55:34 +00:00

Fixes for double.tryParse

This commit is contained in:
Oliver
2021-07-13 00:17:35 +10:00
parent 40613c9c36
commit f058cefad2
3 changed files with 5 additions and 6 deletions

View File

@ -155,9 +155,8 @@ class QuantityField extends TextFormField {
if (value != null && value.isEmpty) return L10().quantityEmpty;
double quantity = double.tryParse(value ?? '0') ?? 0;
double quantity = double.tryParse(value.toString()) ?? 0;
if (quantity == null) return L10().quantityInvalid;
if (quantity <= 0) return L10().quantityPositive;
if ((max != null) && (quantity > max)) return "Quantity must not exceed ${max}";