fix: segmentation violation during serve (#1215)

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
This commit is contained in:
Kay Yan 2024-08-07 16:47:09 +08:00 committed by GitHub
parent ad117a530f
commit b7e5394caa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,7 +149,7 @@ var ServeCmd = &cobra.Command{
}
}
if aiProvider.Name == "" {
if aiProvider == nil || aiProvider.Name == "" {
color.Red("Error: AI provider %s not specified in configuration. Please run k8sgpt auth", backend)
os.Exit(1)
}