fix: add nil check in deer-go LoggerCallback to prevent panic (#89)

drew/english
Second-Choice 10 months ago committed by GitHub
parent b66582819c
commit 928dd90a31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -125,10 +125,12 @@ func (cb *LoggerCallback) pushMsg(ctx context.Context, msgID string, msg *schema
func (cb *LoggerCallback) OnStart(ctx context.Context, info *callbacks.RunInfo, input callbacks.CallbackInput) context.Context {
if inputStr, ok := input.(string); ok {
if cb.Out != nil {
cb.Out <- "\n==================\n"
cb.Out <- fmt.Sprintf(" [OnStart] %s ", inputStr)
cb.Out <- "\n==================\n"
}
}
return ctx
}

Loading…
Cancel
Save