Fix crash on null quantity when adding an item.

This commit is contained in:
Thomas Andres Gomez 2025-06-15 13:23:34 +02:00
parent 51a477bb58
commit 741bb7cf25
2 changed files with 2 additions and 2 deletions

View file

@ -65,6 +65,6 @@ class ItemDetailDialogFactory {
inventoryId: String?,
value: String,
): Boolean {
return floatChecker.matches(value).not() || (inventoryId == null && value.toFloat() < 1f)
return value.isBlank() || floatChecker.matches(value).not() || (inventoryId == null && value.toFloat() < 1f)
}
}

View file

@ -52,7 +52,7 @@ class ItemDetailDialogViewModel(
characterSheetId = ids?.characterSheetId,
items = items,
count = selectedInventoryItem?.count ?: 1f,
equipped = selectedInventoryItem?.equipped ?: false,
equipped = selectedInventoryItem?.equipped == true,
inventoryId = ids?.inventoryId,
itemId = ids?.itemId,
)