Cleaned up some possible bugs

This commit is contained in:
2024-01-07 14:31:10 -07:00
parent d23e5cea74
commit 929214e4dd
3 changed files with 5 additions and 3 deletions

View File

@@ -235,13 +235,13 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In
test, ok := prediction.([]interface{})
if !ok {
fmt.Println("prediction is not []interface{}")
return errorResponse(errors.New("prediction is not []interface{}"))
}
imgUrl, ok := test[0].(string)
if !ok {
fmt.Println("prediction.Output[0] is not a string")
return errorResponse(errors.New("prediction.Output[0] is not a string"))
}
imageRes, imageGetErr := http.Get(imgUrl)