Browse Source

[hide] Prevent Select from crashing if value is missing

Clément Espeute 7 months ago
parent
commit
78b841d05f
1 changed files with 1 additions and 1 deletions
  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 == "") {
 		if (value == null || value == "") {
 			element.val("--- Choose ---");
 			element.val("--- Choose ---");
 		} else {
 		} else {
-			element.val(choices.find((e) -> e.id == value).text);
+			element.val(choices.find((e) -> e.id == value)?.text ?? '<missing value : $value>');
 		}
 		}
 		return value;
 		return value;
 	}
 	}