mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
fix: fix panic on onboarding when no model is selected on the list
* `rm -r ~/.local/share/crush` * run `crush` * type something on the filter so no model is shown on the list * press enter * a panic happens Fixes #285
This commit is contained in:
@@ -196,6 +196,9 @@ func (s *splashCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
if s.isOnboarding && !s.needsAPIKey {
|
||||
modelInx := s.modelList.SelectedIndex()
|
||||
if modelInx == -1 {
|
||||
return s, nil
|
||||
}
|
||||
items := s.modelList.Items()
|
||||
selectedItem := items[modelInx].(completions.CompletionItem).Value().(models.ModelOption)
|
||||
if s.isProviderConfigured(string(selectedItem.Provider.ID)) {
|
||||
|
||||
Reference in New Issue
Block a user