mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
fix: add provider check in isMandatoryWebSearchModel (#9398)
* fix: add provider check in isMandatoryWebSearchModel * Fix: Add provider check in isMandatoryWebSearchModel The isMandatoryWebSearchModel function was throwing an error when the provider was undefined. This change adds a check to ensure the provider exists before accessing its properties, similar to how it's handled in isWebSearchModel. The position of the check has also been moved to be between the provider and modelId initializations for better code flow. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
parent
44b2d09e63
commit
cd1b0e01a0
@ -3014,6 +3014,11 @@ export function isMandatoryWebSearchModel(model: Model): boolean {
|
||||
}
|
||||
|
||||
const provider = getProviderByModel(model)
|
||||
|
||||
if (!provider) {
|
||||
return false
|
||||
}
|
||||
|
||||
const modelId = getLowerBaseModelName(model.id)
|
||||
|
||||
if (provider.id === 'perplexity' || provider.id === 'openrouter') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user