Skip to content

Commit

Permalink
fix: Handle when no default found
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv777 committed Oct 11, 2024
1 parent 8969e98 commit dd5b80a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/asicDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export const coreVoltageOptions: Record<string, DropdownOption[]> = {
export function getDefaultFrequency(model: string): number {
const options = frequencyOptions[model];
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0].value;
return defaultOption ? defaultOption.value : options[0]?.value || 0;
}

export function getDefaultCoreVoltage(model: string): number {
const options = coreVoltageOptions[model];
const defaultOption = options.find(option => option.name.includes('default'));
return defaultOption ? defaultOption.value : options[0].value;
return defaultOption ? defaultOption.value : options[0]?.value || 0;
}

0 comments on commit dd5b80a

Please sign in to comment.