fix: add optional chaining to prevent runtime errors in various components

This commit is contained in:
Danny Avila 2025-04-27 01:40:49 -04:00
parent 670f9b8daf
commit bd3f5f1e77
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
5 changed files with 5 additions and 5 deletions

View file

@ -33,7 +33,8 @@ const ModelParameters: React.FC<ModelParametersProps> = ({
const rangeRef = useRef<HTMLInputElement>(null);
const id = `model-parameter-${ariaLabel.toLowerCase().replace(/\s+/g, '-')}`;
const displayLabel = label.startsWith('com_') ? localize(label as TranslationKeys) : label;
const displayLabel =
label && label.startsWith('com_') ? localize(label as TranslationKeys) : label;
const getDecimalPlaces = (num: number) => {
const match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);