Parcourir la source

[hide] Prevent Select from crashing if value is missing

Clément Espeute il y a 7 mois
Parent
commit
78b841d05f
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      hide/comp/Select.hx

+ 1 - 1
hide/comp/Select.hx

@@ -13,7 +13,7 @@ class Select extends Component {
 		if (value == null || value == "") {
 			element.val("--- Choose ---");
 		} else {
-			element.val(choices.find((e) -> e.id == value).text);
+			element.val(choices.find((e) -> e.id == value)?.text ?? '<missing value : $value>');
 		}
 		return value;
 	}