fix: segmentation violation during serve (#1215)

Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
Kay Yan
2024-08-07 16:47:09 +08:00
committed by AlexsJones
parent e0a7af321d
commit e8ee090977

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)
}